refactor: changed property names for a service
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user