This commit is contained in:
ilham 2021-12-10 14:19:09 +07:00
parent 17c68fa402
commit 6730c773fc

View File

@ -7,7 +7,8 @@ import {
Param, Param,
Delete, Delete,
ParseUUIDPipe, ParseUUIDPipe,
HttpStatus, Query, HttpStatus,
Query,
} from '@nestjs/common'; } from '@nestjs/common';
import { RoleService } from './roles.service'; import { RoleService } from './roles.service';
@ -16,11 +17,11 @@ import { RoleService } from './roles.service';
version: '1', version: '1',
}) })
export class ConfigurableController { export class ConfigurableController {
constructor(private readonly usersService: RoleService) {} constructor(private readonly roleService: RoleService) {}
@Get() @Get('/roles')
async findAll(@Query('page') page: number) { async findAll(@Query('page') page: number) {
const [data, count] = await this.usersService.findAllRoles(page); const [data, count] = await this.roleService.findAllRoles(page);
return { return {
data, data,
@ -33,10 +34,9 @@ export class ConfigurableController {
@Get(':id') @Get(':id')
async findOne(@Param('id', ParseUUIDPipe) id: string) { async findOne(@Param('id', ParseUUIDPipe) id: string) {
return { return {
data: await this.usersService.findOne(id), data: await this.roleService.findOne(id),
statusCode: HttpStatus.OK, statusCode: HttpStatus.OK,
message: 'success', message: 'success',
}; };
} }
} }