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')
@Controller('user')
export class UserController {
constructor(private adminService: UserService) {}
constructor(private userService: UserService) {}
@ApiOperation({
description: 'Create or get user from db',
})
@Post('get')
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) {
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({
where: { id: data.id },
});
@@ -21,7 +21,7 @@ export class UserService {
}
return user;
} catch (error) {
this.logger.log(`[getUser] ${JSON.stringify({ error })}`);
this.logger.log(`[user.getUser] ${JSON.stringify({ error })}`);
}
}
}