Working(tm) implementation of group and team deletion

ref #13
This commit is contained in:
2020-12-04 18:15:38 +01:00
parent c4f02023b9
commit 795599fd38
5 changed files with 56 additions and 23 deletions

View File

@@ -1,10 +1,10 @@
import { JsonController, Param, Body, Get, Post, Put, Delete, OnUndefined } from 'routing-controllers';
import { Body, Delete, Get, JsonController, OnUndefined, Param, Post, Put, QueryParam } from 'routing-controllers';
import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
import { getConnectionManager, Repository } from 'typeorm';
import { EntityFromBody } from 'typeorm-routing-controllers-extensions';
import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
import { Runner } from '../models/entities/Runner';
import { RunnerGroupNeededError, RunnerGroupNotFoundError, RunnerIdsNotMatchingError, RunnerNotFoundError, RunnerOnlyOneGroupAllowedError } from '../errors/RunnerErrors';
import { CreateRunner } from '../models/creation/CreateRunner';
import { Runner } from '../models/entities/Runner';
@JsonController('/runners')
@@ -76,7 +76,7 @@ export class RunnerController {
@ResponseSchema(Runner)
@ResponseSchema(RunnerNotFoundError, { statusCode: 404 })
@OpenAPI({ description: 'Delete a specified runner (if it exists).' })
async remove(@Param('id') id: number) {
async remove(@Param('id') id: number, @QueryParam("force") force: boolean) {
let runner = await this.runnerRepository.findOne({ id: id });
if (!runner) {