diff --git a/src/modules/shifts/services/shifts.service.ts b/src/modules/shifts/services/shifts.service.ts index 5e41c65..6b86ec7 100644 --- a/src/modules/shifts/services/shifts.service.ts +++ b/src/modules/shifts/services/shifts.service.ts @@ -2,7 +2,6 @@ import { Injectable, NotFoundException } from "@nestjs/common"; import { PrismaService } from "src/prisma/prisma.service"; import { CreateShiftDto } from "../dtos/create-shifts.dto"; import { Shifts } from "@prisma/client"; -import { notDeepEqual } from "assert"; import { UpdateShiftsDto } from "../dtos/update-shifts.dto"; @Injectable() @@ -26,7 +25,7 @@ export class ShiftsService { end_time }, include: { - timesheet: { + shift: { include: { employee: { include: { user: true } diff --git a/src/modules/users-management/services/abstract-user.service.ts b/src/modules/users-management/services/abstract-user.service.ts index f8a746a..896627d 100644 --- a/src/modules/users-management/services/abstract-user.service.ts +++ b/src/modules/users-management/services/abstract-user.service.ts @@ -10,16 +10,16 @@ export abstract class AbstractUserService { return this.prisma.users.findMany(); } - async findOne(user_id: number): Promise { - const user = await this.prisma.users.findUnique({ where: { user_id } }); + async findOne(id: string): Promise { + const user = await this.prisma.users.findUnique({ where: { id } }); if (!user) { - throw new NotFoundException(`User #${user_id} not found`); + throw new NotFoundException(`User #${id} not found`); } return user; } - async remove(user_id: number): Promise { - await this.findOne(user_id); - return this.prisma.users.delete({ where: { user_id } }); + async remove(id: string): Promise { + await this.findOne(id); + return this.prisma.users.delete({ where: { id } }); } } diff --git a/src/modules/users-management/users.module.ts b/src/modules/users-management/users.module.ts index 5e13161..5a06f1b 100644 --- a/src/modules/users-management/users.module.ts +++ b/src/modules/users-management/users.module.ts @@ -5,6 +5,6 @@ import { PrismaModule } from 'src/prisma/prisma.module'; @Module({ imports: [PrismaModule], providers: [UsersService], - controllers: [], + exports: [UsersModule], }) export class UsersModule {}