@@ -9,13 +9,22 @@ import {
9
9
Query ,
10
10
UseGuards ,
11
11
} from '@nestjs/common' ;
12
- import { ApiTags } from '@nestjs/swagger' ;
12
+ import {
13
+ ApiBadRequestResponse ,
14
+ ApiBearerAuth ,
15
+ ApiInternalServerErrorResponse ,
16
+ ApiOkResponse ,
17
+ ApiTags ,
18
+ ApiUnauthorizedResponse ,
19
+ } from '@nestjs/swagger' ;
13
20
14
21
import { ShelterManagersService } from './shelter-managers.service' ;
15
22
import { ServerResponse } from '../utils' ;
16
23
import { AdminGuard } from '@/guards/admin.guard' ;
24
+ import { CreateShelterManagerDTO } from './dtos/CreateShelterManagerDTO' ;
17
25
18
26
@ApiTags ( 'Admin de Abrigo' )
27
+ @ApiInternalServerErrorResponse ( )
19
28
@Controller ( 'shelter/managers' )
20
29
export class ShelterManagersController {
21
30
private logger = new Logger ( ShelterManagersController . name ) ;
@@ -24,9 +33,13 @@ export class ShelterManagersController {
24
33
private readonly shelterManagerServices : ShelterManagersService ,
25
34
) { }
26
35
36
+ @ApiBearerAuth ( )
37
+ @ApiUnauthorizedResponse ( )
38
+ @ApiBadRequestResponse ( )
39
+ @ApiOkResponse ( )
27
40
@Post ( '' )
28
41
@UseGuards ( AdminGuard )
29
- async store ( @Body ( ) body ) {
42
+ async store ( @Body ( ) body : CreateShelterManagerDTO ) {
30
43
try {
31
44
await this . shelterManagerServices . store ( body ) ;
32
45
return new ServerResponse ( 200 , 'Successfully added manager to shelter' ) ;
@@ -36,6 +49,7 @@ export class ShelterManagersController {
36
49
}
37
50
}
38
51
52
+ @ApiOkResponse ( )
39
53
@Get ( ':shelterId' )
40
54
async index (
41
55
@Param ( 'shelterId' ) shelterId : string ,
0 commit comments