File

libs/users/application/src/lib/use-cases/get-user-by-id.use-case.ts

Index

Methods

Constructor

constructor(usersService: UsersService)
Parameters :
Name Type Optional
usersService UsersService No

Methods

Async execute
execute(id: string)
Parameters :
Name Type Optional
id string No
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);
  }
}

results matching ""

    No results matching ""