Rename to user

This commit is contained in:
2023-11-20 19:09:02 +03:00
parent ceedff498c
commit 266613b17e
2 changed files with 4 additions and 4 deletions

View File

@@ -6,13 +6,13 @@ import { UserService } from './user.service';
@ApiTags('User') @ApiTags('User')
@Controller('user') @Controller('user')
export class UserController { export class UserController {
constructor(private adminService: UserService) {} constructor(private userService: UserService) {}
@ApiOperation({ @ApiOperation({
description: 'Create or get user from db', description: 'Create or get user from db',
}) })
@Post('get') @Post('get')
async getUser(@Body() data: IGetUser) { async getUser(@Body() data: IGetUser) {
return await this.adminService.getUser(data); return await this.userService.getUser(data);
} }
} }

View File

@@ -11,7 +11,7 @@ export class UserService {
async getUser(data: IGetUser) { async getUser(data: IGetUser) {
try { try {
this.logger.debug(`[admin.getUser] data: ${JSON.stringify(data)}`); this.logger.debug(`[user.getUser] data: ${JSON.stringify(data)}`);
let user = await this.userRepository.findOne({ let user = await this.userRepository.findOne({
where: { id: data.id }, where: { id: data.id },
}); });
@@ -21,7 +21,7 @@ export class UserService {
} }
return user; return user;
} catch (error) { } catch (error) {
this.logger.log(`[getUser] ${JSON.stringify({ error })}`); this.logger.log(`[user.getUser] ${JSON.stringify({ error })}`);
} }
} }
} }