Skip to content

Commit 322f12d

Browse files
authored
feat: 구매하기 request body에 user id 포함 (#404)
1 parent 74c36b6 commit 322f12d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pages/payment/Purchase.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ import "./Purchase.scss";
3131
import "./../../styles/utilities.css";
3232
import AmountChangePurchase from "@/components/detail/AmountChangePurchase";
3333
import PurchaseMethodBtn from "@/components/purchase/PurchaseMethodBtn";
34+
import AuthContext from "@/contexts/AuthContext";
3435

3536
const Purchase = () => {
37+
const { user } = useContext(AuthContext);
3638
const [thumbnailImg, setThumbnailImg] = useState("");
3739
const [title, setTitle] = useState("");
3840
const [author, setAuthor] = useState("");
@@ -203,7 +205,8 @@ const Purchase = () => {
203205
performanceAmount: buyPerform ? modifiedPurchasePerformAmount : 0,
204206
},
205207
],
206-
paymentMethod: payableAmount === 0 ? 0 : 1, // 0원: 0, 유료: 1
208+
paymentMethod: payableAmount === 0 ? 0 : 1, // 0원: 0, 유료: 1,
209+
userId: user?.id,
207210
};
208211

209212
if (buyPerform) {

0 commit comments

Comments
 (0)