Went back to using id's for deletion (for cleaner query params)
ref #13 #17
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Body, Delete, Get, JsonController, OnUndefined, Param, Post, Put } from 'routing-controllers';
|
||||
import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
|
||||
import { getConnectionManager, Repository } from 'typeorm';
|
||||
import { EntityFromBody, EntityFromParam } from 'typeorm-routing-controllers-extensions';
|
||||
import { EntityFromBody } from 'typeorm-routing-controllers-extensions';
|
||||
import { UserIdsNotMatchingError, UserNotFoundError } from '../errors/UserErrors';
|
||||
import { UserGroupNotFoundError } from '../errors/UserGroupErrors';
|
||||
import { CreateUser } from '../models/actions/CreateUser';
|
||||
@@ -76,7 +76,8 @@ export class UserController {
|
||||
@ResponseSchema(ResponseEmpty, { statusCode: 204 })
|
||||
@OnUndefined(204)
|
||||
@OpenAPI({ description: 'Delete a specified runner (if it exists).' })
|
||||
async remove(@EntityFromParam('id') user: User) {
|
||||
async remove(@Param("id") id: number) {
|
||||
let user = await this.userRepository.findOne({ id: id });
|
||||
if (!user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user