Skip to content

Commit 5d57f08

Browse files
committed
fix: 영수증 URL 계산을 컴포넌트에서 하도록 수정
1 parent d9fc18a commit 5d57f08

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

packages/shop/src/components/features/order.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,14 @@ const PaymentHistoryStatusTranslated: {
3131
refunded: "환불됨",
3232
};
3333

34-
const OrderItem: React.FC<{
35-
order: ShopSchemas.Order;
36-
disabled?: boolean;
37-
}> = ({ order, disabled }) => {
34+
const OrderItem: React.FC<{ order: ShopSchemas.Order; disabled?: boolean }> = ({ order, disabled }) => {
35+
const { shopApiDomain } = ShopHooks.useShopContext();
3836
const orderRefundMutation = ShopHooks.useOrderRefundMutation();
3937
const oneItemRefundMutation = ShopHooks.useOneItemRefundMutation();
4038
const optionsOfOneItemInOrderPatchMutation = ShopHooks.useOptionsOfOneItemInOrderPatchMutation();
4139

4240
const refundOrder = () => orderRefundMutation.mutate({ order_id: order.id });
43-
const openReceipt = () => window.open(ShopUtils.getReceiptUrlFromOrder(order), "_blank");
41+
const openReceipt = () => window.open(`${shopApiDomain}/v1/orders/${order.id}/receipt/`, "_blank");
4442

4543
const isPending =
4644
disabled ||

packages/shop/src/utils/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as R from "remeda";
22

3-
import ShopHooks from '../hooks';
43
import ShopSchemas from "../schemas";
54
import { startPortOnePurchase as _startPortOnePurchase } from "./portone";
65

@@ -30,11 +29,6 @@ namespace ShopAPIUtil {
3029
return false;
3130
};
3231

33-
export const getReceiptUrlFromOrder = (order: ShopSchemas.Order) => {
34-
const { shopApiDomain } = ShopHooks.useShopContext();
35-
return `${shopApiDomain}/v1/orders/${order.id}/receipt/`;
36-
}
37-
3832
export const startPortOnePurchase = _startPortOnePurchase;
3933
}
4034

0 commit comments

Comments
 (0)