libs/users/application/src/lib/use-cases/get-user-by-id.use-case.ts
Methods |
|
constructor(usersService: UsersService)
|
||||||
Parameters :
|
Async execute | ||||||
execute(id: string)
|
||||||
Parameters :
Returns :
Promise<User>
|
import { Injectable } from '@nestjs/common';
import { User } from '@users/domain';
import { UsersService } from '../users.service';
@Injectable()
export class GetUserByIdUseCase {
constructor(private readonly usersService: UsersService) {}
async execute(id: string): Promise<User> {
return await this.usersService.findOneById(id);
}
}