add: progress authentication
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
Param,
|
||||
Delete,
|
||||
ParseUUIDPipe,
|
||||
HttpStatus,
|
||||
HttpStatus, Query,
|
||||
} from '@nestjs/common';
|
||||
import { ConfigurableService } from './configurable.service';
|
||||
|
||||
@@ -19,8 +19,8 @@ export class ConfigurableController {
|
||||
constructor(private readonly usersService: ConfigurableService) {}
|
||||
|
||||
@Get()
|
||||
async findAll() {
|
||||
const [data, count] = await this.usersService.findAll();
|
||||
async findAll(@Query('page') page: number) {
|
||||
const [data, count] = await this.usersService.findAllRoles(page);
|
||||
|
||||
return {
|
||||
data,
|
||||
|
||||
@@ -10,8 +10,14 @@ export class ConfigurableService {
|
||||
private rolesRepository: Repository<Roles>,
|
||||
) {}
|
||||
|
||||
findAll() {
|
||||
return this.rolesRepository.findAndCount();
|
||||
findAllRoles(page) {
|
||||
return this.rolesRepository.findAndCount({
|
||||
skip: page * 10,
|
||||
take: 10,
|
||||
order: {
|
||||
version: 'DESC',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async findOne(id: string) {
|
||||
|
||||
Reference in New Issue
Block a user