From 6730c773fcef6969a50466584033a08a2798561e Mon Sep 17 00:00:00 2001 From: ilham Date: Fri, 10 Dec 2021 14:19:09 +0700 Subject: [PATCH] add --- src/configurable/configurable.controller.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/configurable/configurable.controller.ts b/src/configurable/configurable.controller.ts index 8d4d3ca..f1ca79c 100644 --- a/src/configurable/configurable.controller.ts +++ b/src/configurable/configurable.controller.ts @@ -7,7 +7,8 @@ import { Param, Delete, ParseUUIDPipe, - HttpStatus, Query, + HttpStatus, + Query, } from '@nestjs/common'; import { RoleService } from './roles.service'; @@ -16,11 +17,11 @@ import { RoleService } from './roles.service'; version: '1', }) export class ConfigurableController { - constructor(private readonly usersService: RoleService) {} + constructor(private readonly roleService: RoleService) {} - @Get() + @Get('/roles') async findAll(@Query('page') page: number) { - const [data, count] = await this.usersService.findAllRoles(page); + const [data, count] = await this.roleService.findAllRoles(page); return { data, @@ -33,10 +34,9 @@ export class ConfigurableController { @Get(':id') async findOne(@Param('id', ParseUUIDPipe) id: string) { return { - data: await this.usersService.findOne(id), + data: await this.roleService.findOne(id), statusCode: HttpStatus.OK, message: 'success', }; } - }