Skip to content

Commit

Permalink
Rename the post /invalidate-stripe-payment/:id to a patch /:id/invali…
Browse files Browse the repository at this point in the history
…date to match the REST guidelines better.
  • Loading branch information
slavcho committed Jan 23, 2024
1 parent 5afeea4 commit 275dd78
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions apps/api/src/donations/donations.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@ export class DonationsController {
return this.donationsService.createUpdateBankPayment(bankPaymentDto)
}

@Patch('/:id/invalidate')
@Roles({
roles: [EditFinancialsRequests.role],
mode: RoleMatchingMode.ANY,
})
invalidate(@Param('id') id: string) {
Logger.debug(`Invalidating donation with id ${id}`)
return this.donationsService.invalidate(id)
}

@Patch(':id')
@Roles({
roles: [RealmViewSupporters.role, ViewSupporters.role],
Expand All @@ -251,17 +261,9 @@ export class DonationsController {
@Body()
updatePaymentDto: UpdatePaymentDto,
) {
return this.donationsService.update(id, updatePaymentDto)
}
Logger.debug(`Updating donation with id ${id}`)

@Post('/invalidate-stripe-payment/:id')
@Roles({
roles: [EditFinancialsRequests.role],
mode: RoleMatchingMode.ANY,
})
invalidate(@Param('id') id: string) {
Logger.debug(`Invalidating donation with id ${id}`)
return this.donationsService.invalidate(id)
return this.donationsService.update(id, updatePaymentDto)
}

@Post('delete')
Expand Down

0 comments on commit 275dd78

Please sign in to comment.