parent
3df1db4ad8
commit
61a17b198f
@ -92,15 +92,17 @@ export class DonorController {
|
|||||||
@OnUndefined(204)
|
@OnUndefined(204)
|
||||||
@OpenAPI({ description: 'Delete the runner whose id you provided. <br> If no runner with this id exists it will just return 204(no content).' })
|
@OpenAPI({ description: 'Delete the runner whose id you provided. <br> If no runner with this id exists it will just return 204(no content).' })
|
||||||
async remove(@Param("id") id: number, @QueryParam("force") force: boolean) {
|
async remove(@Param("id") id: number, @QueryParam("force") force: boolean) {
|
||||||
let runner = await this.donorRepository.findOne({ id: id });
|
let donor = await this.donorRepository.findOne({ id: id });
|
||||||
if (!runner) { return null; }
|
if (!donor) { return null; }
|
||||||
const responseRunner = await this.donorRepository.findOne(runner, { relations: ['scans', 'group'] });
|
const responseDonor = await this.donorRepository.findOne(donor);
|
||||||
|
|
||||||
if (!runner) {
|
if (!donor) {
|
||||||
throw new RunnerNotFoundError();
|
throw new RunnerNotFoundError();
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.donorRepository.delete(runner);
|
//TODO: DELETE DONATIONS AND WARN FOR FORCE
|
||||||
return new ResponseDonor(responseRunner);
|
|
||||||
|
await this.donorRepository.delete(donor);
|
||||||
|
return new ResponseDonor(responseDonor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user