file service module added
This commit is contained in:
@@ -13,7 +13,7 @@ import { UserService } from './user.service';
|
||||
export class UserController {
|
||||
constructor(private readonly userService: UserService) {}
|
||||
|
||||
// @AllowAnonymous()
|
||||
@Roles(['admin'])
|
||||
@Get()
|
||||
async getAllUsers() {
|
||||
return this.userService.getAllUsers();
|
||||
@@ -25,16 +25,19 @@ export class UserController {
|
||||
return this.userService.getUserById(id);
|
||||
}
|
||||
|
||||
@Roles(['admin'])
|
||||
@Delete(':id')
|
||||
async deleteUser(@Param('id') id: string) {
|
||||
return this.userService.deleteUser(id);
|
||||
}
|
||||
|
||||
@Roles(['admin'])
|
||||
@Get(':id/sessions')
|
||||
async getSessionsByUser(@Param('id') id: string) {
|
||||
return this.userService.getSessionsByUserId(id);
|
||||
}
|
||||
|
||||
@Roles(['admin'])
|
||||
@Delete(':id/sessions/:sessionId')
|
||||
async removeSession(
|
||||
@Param('id') userId: string,
|
||||
@@ -43,6 +46,7 @@ export class UserController {
|
||||
return this.userService.removeSession(userId, sessionId);
|
||||
}
|
||||
|
||||
@Roles(['admin'])
|
||||
@Delete(':id/sessions')
|
||||
async removeAllSessions(@Param('id') id: string) {
|
||||
return this.userService.removeAllSessions(id);
|
||||
|
||||
Reference in New Issue
Block a user