diff --git a/apps/post/src/post.controller.ts b/apps/post/src/post.controller.ts index cd59014..8869f94 100644 --- a/apps/post/src/post.controller.ts +++ b/apps/post/src/post.controller.ts @@ -82,6 +82,6 @@ export class PostController { */ @MessagePattern(POST_PATTERNS.DELETE_POST) async deleteEntity(data: DeletePostDto): Promise { - return this.postService.deleteUser(data); + return this.postService.deleteEntity(data); } } diff --git a/apps/post/src/post.service.ts b/apps/post/src/post.service.ts index 3a874a1..2a1c914 100644 --- a/apps/post/src/post.service.ts +++ b/apps/post/src/post.service.ts @@ -50,7 +50,7 @@ export class PostService { * Delete entity * @param data */ - async deleteUser(data: DeletePostDto): Promise { + async deleteEntity(data: DeletePostDto): Promise { return this.prismaService.post.delete({ where: data }); } } diff --git a/apps/user/src/user.controller.ts b/apps/user/src/user.controller.ts index 9a0375f..fe54cc6 100644 --- a/apps/user/src/user.controller.ts +++ b/apps/user/src/user.controller.ts @@ -42,7 +42,7 @@ export class UserController { */ @MessagePattern(USER_PATTERNS.CREATE_USER) async createEntity(data: CreateUserDto): Promise { - const existUser = await this.userService.checkExistUser(data.name); + const existUser = await this.userService.checkExistEntity(data.name); if (existUser) { throw new Error('Choose another user'); @@ -57,7 +57,7 @@ export class UserController { */ @MessagePattern(USER_PATTERNS.UPDATE_USER) async updateEntity(data: UpdateUserDto): Promise { - const existUser = await this.userService.checkExistUser(data.name); + const existUser = await this.userService.checkExistEntity(data.name); if (existUser) { throw new Error('Choose another user'); @@ -72,6 +72,6 @@ export class UserController { */ @MessagePattern(USER_PATTERNS.DELETE_USER) async deleteEntity(data: DeleteUserDto): Promise { - return this.userService.deleteUser(data); + return this.userService.deleteEntity(data); } } diff --git a/apps/user/src/user.service.ts b/apps/user/src/user.service.ts index 7273257..5af084d 100644 --- a/apps/user/src/user.service.ts +++ b/apps/user/src/user.service.ts @@ -50,15 +50,15 @@ export class UserService { * Delete entity * @param data */ - async deleteUser(data: DeleteUserDto): Promise { + async deleteEntity(data: DeleteUserDto): Promise { return this.prismaService.user.delete({ where: data }); } /** - * Check exist user + * Check exist entity * @param userName */ - async checkExistUser(userName: string): Promise { + async checkExistEntity(userName: string): Promise { return this.prismaService.user.findUnique({ where: { name: userName } }); } }