feat(users): add updateAdmin endpoint and enhance role assignment

- Introduced `PATCH /admin/:uuid` endpoint for admin-specific user updates.
- Updated `update` logic to handle role assignment via `rbacService`.
- Refactored `findAll` method in repository for improved readability.
This commit is contained in:
Mathis HERRIOT
2026-01-21 13:20:32 +01:00
parent c8820a71b6
commit f5c90b0ae4
3 changed files with 21 additions and 2 deletions

View File

@@ -112,6 +112,16 @@ export class UsersController {
return this.usersService.remove(uuid);
}
@Patch("admin/:uuid")
@UseGuards(AuthGuard, RolesGuard)
@Roles("admin")
updateAdmin(
@Param("uuid") uuid: string,
@Body() updateUserDto: UpdateUserDto,
) {
return this.usersService.update(uuid, updateUserDto);
}
// Double Authentification (2FA)
@Post("me/2fa/setup")
@UseGuards(AuthGuard)