This commit is contained in:
IO
2024-07-03 14:55:06 -06:00
parent 208715a6e1
commit 97fd5b27eb
2 changed files with 43 additions and 4 deletions
+17 -4
View File
@@ -10,7 +10,8 @@ import {
Request,
UseGuards,
Delete,
ParseIntPipe
ParseIntPipe,
Query
} from '@nestjs/common';
import { AuthGuard } from './auth.guard';
import { AuthService } from './auth.service';
@@ -44,9 +45,21 @@ export class AuthController {
return this.authService.findAll();
}
@Get(':id_user')
async profile(@Param('id_user', ParseIntPipe) id_user: number) {
return this.authService.profile(id_user);
@Get('page')
findAllPaginated(
@Query('page') page: number = 1,
@Query('limit') limit: number = 10,
@Query() filters: any
) {
page = page < 1 ? 1 : page;
limit = limit > 10 || limit < 1 ? 10 : limit;
return this.authService.findAllPaginated(page, limit,filters);
}
@Get(':id_usuario')
async profile(@Param('id_usuario', ParseIntPipe) id_usuario: number) {
return this.authService.profile(id_usuario);
}
//@UseGuards(AuthGuard)