File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
ClubService.API/Controller Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ namespace ClubService.API.Controller;
9
9
[ Route ( "api/v{version:apiVersion}/admins" ) ]
10
10
[ ApiController ]
11
11
[ ApiVersion ( "1.0" ) ]
12
- public class AdminController ( IRegisterAdminService registerAdminService , IDeleteAdminService deleteAdminService )
12
+ public class AdminController (
13
+ IRegisterAdminService registerAdminService ,
14
+ IDeleteAdminService deleteAdminService ,
15
+ IUpdateAdminService updateAdminService )
13
16
: ControllerBase
14
17
{
15
18
[ HttpPost ]
@@ -34,4 +37,19 @@ public async Task<ActionResult<string>> DeleteAdmin(string id)
34
37
var deletedAdminId = await deleteAdminService . DeleteAdmin ( id ) ;
35
38
return Ok ( deletedAdminId ) ;
36
39
}
40
+
41
+ [ HttpPatch ( "{id}" ) ]
42
+ [ ProducesResponseType ( StatusCodes . Status200OK ) ]
43
+ [ ProducesResponseType ( StatusCodes . Status404NotFound ) ]
44
+ [ ProducesResponseType ( StatusCodes . Status400BadRequest ) ]
45
+ [ ProducesResponseType ( StatusCodes . Status500InternalServerError ) ]
46
+ public async Task < ActionResult < string > > UpdateAdmin ( string id , [ FromBody ] AdminUpdateCommand adminUpdateCommand )
47
+ {
48
+ var updatedAdminId = await updateAdminService . ChangeFullName (
49
+ id ,
50
+ adminUpdateCommand . FirstName ,
51
+ adminUpdateCommand . LastName
52
+ ) ;
53
+ return Ok ( updatedAdminId ) ;
54
+ }
37
55
}
You can’t perform that action at this time.
0 commit comments