import { Injectable } from '@nestjs/common'; import { PrismaService } from '@/src/prisma.service'; import { users } from '@prisma/client'; @Injectable() export class UsersService { constructor(private prisma: PrismaService) {} async findAll(): Promise { return this.prisma.users.findMany(); } async findOne(id: number): Promise { return this.prisma.users.findUnique({ where: { id } }); } async create(data: any): Promise { return this.prisma.users.create({ data }); } async update(id: number, data: any): Promise { return this.prisma.users.update({ where: { id }, data }); } async remove(id: number): Promise { return this.prisma.users.delete({ where: { id } }); } }