parent
8ee2bdf488
commit
bbaee7cd4d
|
@ -82,23 +82,24 @@ export class DonationController {
|
|||
// @Put('/:id')
|
||||
// @Authorized("SCAN:UPDATE")
|
||||
// @ResponseSchema(ResponseScan)
|
||||
// @ResponseSchema(ScanNotFoundError, { statusCode: 404 })
|
||||
// @ResponseSchema(DonationNotFoundError, { statusCode: 404 })
|
||||
// @ResponseSchema(DonorNotFoundError, { statusCode: 404 })
|
||||
// @ResponseSchema(RunnerNotFoundError, { statusCode: 404 })
|
||||
// @ResponseSchema(ScanIdsNotMatchingError, { statusCode: 406 })
|
||||
// @OpenAPI({ description: "Update the scan (not track scan use /scans/trackscans/:id instead) whose id you provided. <br> Please remember that ids can't be changed and distances must be positive." })
|
||||
// async put(@Param('id') id: number, @Body({ validate: true }) scan: UpdateScan) {
|
||||
// let oldScan = await this.scanRepository.findOne({ id: id });
|
||||
// @ResponseSchema(DonationIdsNotMatchingError, { statusCode: 406 })
|
||||
// @OpenAPI({ description: "Update the fixed donation (not distance donation - use /donations/fixed instead) whose id you provided. <br> Please remember that ids can't be changed and amounts must be positive." })
|
||||
// async putFixed(@Param('id') id: number, @Body({ validate: true }) donation: UpdateDistanceDonation) {
|
||||
// let oldDonation = await this.fixedDonationRepository.findOne({ id: id });
|
||||
|
||||
// if (!oldScan) {
|
||||
// if (!oldDonation) {
|
||||
// throw new ScanNotFoundError();
|
||||
// }
|
||||
|
||||
// if (oldScan.id != scan.id) {
|
||||
// if (oldDonation.id != donation.id) {
|
||||
// throw new ScanIdsNotMatchingError();
|
||||
// }
|
||||
|
||||
// await this.scanRepository.save(await scan.update(oldScan));
|
||||
// return (await this.scanRepository.findOne({ id: id }, { relations: ['runner', 'track', 'runner.scans', 'runner.scans.track', 'card', 'station'] })).toResponse();
|
||||
// await this.fixedDonationRepository.save(await donation.update(oldDonation));
|
||||
// return (await this.donationRepository.findOne({ id: donation.id }, { relations: ['donor'] })).toResponse();
|
||||
// }
|
||||
|
||||
// @Put('/trackscans/:id')
|
||||
|
|
Loading…
Reference in New Issue