feat: add class-transformer dependency for better data transformation
refactor(prisma): update User model to include banned status and ban details refactor(prisma): modify Account model to include new authentication fields refactor(prisma): enhance Session model with impersonation tracking refactor(prisma): adjust Verification model to include value field feat(auth): integrate admin plugin and enhance email verification process refactor(category): enforce ownership checks in category service methods refactor(item): update item service to validate category ownership feat(item): add ability to fetch items by category refactor(restaurant): implement ownership checks and admin routes in restaurant controller fix(user): restrict user access to admin routes feat(exception): implement global exception filter for consistent error handling
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { Controller, Get, Param, Delete, UseGuards } from '@nestjs/common';
|
||||
import { AuthGuard, Session } from '@thallesp/nestjs-better-auth';
|
||||
import {
|
||||
AuthGuard,
|
||||
Session,
|
||||
AllowAnonymous,
|
||||
Roles,
|
||||
} from '@thallesp/nestjs-better-auth';
|
||||
import type { UserSession } from '@thallesp/nestjs-better-auth';
|
||||
import { UserService } from './user.service';
|
||||
|
||||
@@ -8,11 +13,13 @@ import { UserService } from './user.service';
|
||||
export class UserController {
|
||||
constructor(private readonly userService: UserService) {}
|
||||
|
||||
// @AllowAnonymous()
|
||||
@Get()
|
||||
async getAllUsers() {
|
||||
return this.userService.getAllUsers();
|
||||
}
|
||||
|
||||
@Roles(['admin'])
|
||||
@Get(':id')
|
||||
async getUserById(@Param('id') id: string) {
|
||||
return this.userService.getUserById(id);
|
||||
|
||||
Reference in New Issue
Block a user