@@ -88,12 +88,9 @@ export class RunnerTeamController {
|
||||
@ResponseSchema(RunnerTeamHasRunnersError, { statusCode: 406 })
|
||||
@OpenAPI({ description: 'Delete a specified runnerTeam (if it exists).' })
|
||||
async remove(@EntityFromParam('id') team: RunnerTeam, @QueryParam("force") force: boolean) {
|
||||
if (!team) { throw new RunnerTeamNotFoundError(); }
|
||||
let runnerTeam = await this.runnerTeamRepository.findOne(team, { relations: ['parentGroup', 'contact', 'runners'] });
|
||||
|
||||
if (!runnerTeam) {
|
||||
throw new RunnerTeamNotFoundError();
|
||||
}
|
||||
|
||||
if (!force) {
|
||||
if (runnerTeam.runners.length != 0) {
|
||||
throw new RunnerTeamHasRunnersError();
|
||||
|
||||
Reference in New Issue
Block a user