refactor: changed property names for a service

This commit is contained in:
user
2021-09-14 19:16:25 +02:00
parent f65c8cdfb6
commit b95efb7179
3 changed files with 5 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ import { CreateUserHttpRequest } from './create-user.request.dto';
export class CreateUserHttpController {
constructor(
@Inject(createUserSymbol)
private readonly createUser: CreateUserService,
private readonly service: CreateUserService,
) {}
@Post(routes.user.root)
@@ -30,7 +30,7 @@ export class CreateUserHttpController {
async create(@Body() body: CreateUserHttpRequest): Promise<IdResponse> {
const command = new CreateUserCommand(body);
const id = await this.createUser.createUser(command);
const id = await this.service.createUser(command);
return new IdResponse(id.value);
}

View File

@@ -9,14 +9,14 @@ import { CreateUserService } from './create-user.service';
export class CreateUserMessageController {
constructor(
@Inject(createUserSymbol)
private readonly createUser: CreateUserService,
private readonly service: CreateUserService,
) {}
@MessagePattern('user.create') // <- Subscribe to a microservice message
async create(message: CreateUserMessageRequest): Promise<IdResponse> {
const command = new CreateUserCommand(message);
const id = await this.createUser.createUser(command);
const id = await this.service.createUser(command);
return new IdResponse(id.value);
}

View File

@@ -11,7 +11,7 @@ export class FindUsersHttpController {
/* Since this is a simple query with no additional business
logic involved, it bypasses application's core completely
and retrieves user directly from repository.
and retrieves users directly from a repository.
*/
@Get(routes.user.root)
async findUsers(