Skip to content

Commit

Permalink
move payload from body field to function parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ratchet7x5 committed Dec 13, 2024
1 parent 0b740c6 commit f5d5beb
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions web/src/api/apiRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,24 @@ export const fetchEventOrMembershipCheckoutSecret = async (payload: {
priceId: string;
userTicketId: number;
}): Promise<string> => {
const response = await apiClient.post("/api/stripe/create-checkout", {
method: "POST",
headers: { "Content-Type": "application/json" },
// add our own priceId here later for different products
body: JSON.stringify(payload),
});
console.log(
"fetchEventOrMembershipCheckoutSecret: payload:",
payload.priceId,
payload.userTicketId
);
const response = await apiClient.post(
"/api/stripe/create-checkout",
payload,
{
method: "POST",
headers: { "Content-Type": "application/json" },
}
);

console.log(
"fetchEventOrMembershipCheckoutSecret: response.data.clientSecret: ",
response.data
);

return response.data.clientSecret;
};
Expand Down

0 comments on commit f5d5beb

Please sign in to comment.