import { Injectable, NotFoundException } from '@nestjs/common' import { PrismaService } from 'nestjs-prisma' import { Prisma } from '@prisma/client' import { UserEntity } from './entities/user.entity' @Injectable() export class UsersService { constructor(private prismaService: PrismaService) {} async findUser(where: Prisma.UserWhereUniqueInput): Promise { const user = await this.prismaService.user.findUnique({ where, }) if (!user) { throw new NotFoundException(`No user found`) } return user } }