add: progress authentication

This commit is contained in:
ilham
2021-12-06 09:12:52 +07:00
parent 5bbb650acd
commit 2b5abc7689
12 changed files with 154 additions and 40 deletions

View File

@@ -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,

View File

@@ -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) {