Skip to content

Commit

Permalink
Change the API for the invalidation of a donation to be more REST fri…
Browse files Browse the repository at this point in the history
…endly.
  • Loading branch information
slavcho committed Jan 23, 2024
1 parent 151f17e commit 2c28b45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/service/apiEndpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const endpoints = {
refundStripePayment: (id: string) =>
<Endpoint>{ url: `/donation/refund-stripe-payment/${id}`, method: 'POST' },
invalidateStripePayment: (id: string) =>
<Endpoint>{ url: `/donation/invalidate-stripe-payment/${id}`, method: 'POST' },
<Endpoint>{ url: `/donation/${id}/invalidate`, method: 'PATCH' },
getDonation: (id: string) => <Endpoint>{ url: `/donation/${id}`, method: 'GET' },
donationsList: (
campaignId?: string,
Expand Down
2 changes: 1 addition & 1 deletion src/service/donation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const useRefundStripeDonation = () => {
export const useInvalidateStripeDonation = () => {
const { data: session } = useSession()
return async (extPaymentId: string) => {
return await apiClient.post(
return await apiClient.patch(
endpoints.donation.invalidateStripePayment(extPaymentId).url,
'',
authConfig(session?.accessToken),
Expand Down

0 comments on commit 2c28b45

Please sign in to comment.