Compare commits

...

3 Commits

Author SHA1 Message Date
Nicolai Ort 490fbd241d Merge pull request 'Alpha Release 0.0.10' (#83) from dev into main
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/push Build is passing Details
Reviewed-on: #83
Reviewed-by: Philipp Dormann <philipp@philippdormann.de>
2021-01-08 20:15:27 +00:00
Nicolai Ort f132131156 Version bump
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2021-01-08 21:14:20 +01:00
Nicolai Ort c1e680a063 Fixed responsescheme for the user controller
continuous-integration/drone/push Build is failing Details
2021-01-08 21:13:41 +01:00
2 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@odit/lfk-backend",
"version": "0.0.9",
"version": "0.0.10",
"main": "src/app.ts",
"repository": "https://git.odit.services/lfk/backend",
"author": {

View File

@ -25,7 +25,7 @@ export class UserController {
@Get()
@Authorized("USER:GET")
@ResponseSchema(User, { isArray: true })
@ResponseSchema(ResponseUser, { isArray: true })
@OpenAPI({ description: 'Lists all users. <br> This includes their groups and permissions directly granted to them (if existing/associated).' })
async getAll() {
let responseUsers: ResponseUser[] = new Array<ResponseUser>();
@ -38,7 +38,7 @@ export class UserController {
@Get('/:id')
@Authorized("USER:GET")
@ResponseSchema(User)
@ResponseSchema(ResponseUser)
@ResponseSchema(UserNotFoundError, { statusCode: 404 })
@OnUndefined(UserNotFoundError)
@OpenAPI({ description: 'Lists all information about the user whose id got provided. <br> Please remember that only permissions granted directly to the user will show up here, not permissions inherited from groups.' })
@ -50,7 +50,7 @@ export class UserController {
@Post()
@Authorized("USER:CREATE")
@ResponseSchema(User)
@ResponseSchema(ResponseUser)
@ResponseSchema(UserGroupNotFoundError)
@OpenAPI({ description: 'Create a new user. <br> If you want to grant permissions to the user you have to create them seperately by posting to /api/permissions after creating the user.' })
async post(@Body({ validate: true }) createUser: CreateUser) {
@ -67,7 +67,7 @@ export class UserController {
@Put('/:id')
@Authorized("USER:UPDATE")
@ResponseSchema(User)
@ResponseSchema(ResponseUser)
@ResponseSchema(UserNotFoundError, { statusCode: 404 })
@ResponseSchema(UserIdsNotMatchingError, { statusCode: 406 })
@OpenAPI({ description: "Update the user whose id you provided. <br> To change the permissions directly granted to the user please use /api/permissions instead. <br> Please remember that ids can't be changed." })
@ -88,7 +88,7 @@ export class UserController {
@Delete('/:id')
@Authorized("USER:DELETE")
@ResponseSchema(User)
@ResponseSchema(ResponseUser)
@ResponseSchema(ResponseEmpty, { statusCode: 204 })
@OnUndefined(204)
@OpenAPI({ description: 'Delete the user whose id you provided. <br> If there are any permissions directly granted to the user they will get deleted as well. <br> If no user with this id exists it will just return 204(no content).' })