add recorator

This commit is contained in:
2025-11-16 10:07:53 +03:30
parent 64ac2ead36
commit ad4b2e2c89
11 changed files with 119 additions and 47 deletions
+2 -2
View File
@@ -96,14 +96,14 @@ export class UserService {
return user;
}
async findAll(dto: FindUsersDto): Promise<PaginatedResult<User>> {
async findAll(restId: string, dto: FindUsersDto): Promise<PaginatedResult<User>> {
const { page = 1, limit = 10, search, orderBy = 'createdAt', order = 'desc' } = dto;
// 1. Calculate pagination
const offset = (page - 1) * limit;
// 2. Build the 'where' filter query
const where: FilterQuery<User> = {};
const where: FilterQuery<User> = { restaurant: { id: restId } };
// 4. Add 'search' logic (case-insensitive)
if (search) {