auth services implmented

This commit is contained in:
2025-07-25 22:46:37 +03:00
parent 8ca2d34dc6
commit b4b752ca3a
92 changed files with 5282 additions and 296 deletions

View File

@@ -1,31 +1,28 @@
import { Injectable } from '@nestjs/common';
import { PrismaService } from '@/prisma.service';
import { User } from '@prisma/client';
import { PrismaService } from '@/src/prisma.service';
import { users } from '@prisma/client';
@Injectable()
export class UsersService {
constructor(private prisma: PrismaService) {}
async findAll(): Promise<User[]> {
return this.prisma.user.findMany();
async findAll(): Promise<users[]> {
return this.prisma.users.findMany();
}
async findOne(id: number): Promise<User | null> {
return this.prisma.user.findUnique({ where: { id } });
async findOne(id: number): Promise<users | null> {
return this.prisma.users.findUnique({ where: { id } });
}
async create(data: { name: string; email: string }): Promise<User> {
return this.prisma.user.create({ data });
async create(data: any): Promise<users> {
return this.prisma.users.create({ data });
}
async update(
id: number,
data: Partial<{ name: string; email: string }>,
): Promise<User> {
return this.prisma.user.update({ where: { id }, data });
async update(id: number, data: any): Promise<users> {
return this.prisma.users.update({ where: { id }, data });
}
async remove(id: number): Promise<User> {
return this.prisma.user.delete({ where: { id } });
async remove(id: number): Promise<users> {
return this.prisma.users.delete({ where: { id } });
}
}