diff --git a/src/time-and-attendance/modules/time-tracker/timesheets/services/timesheet-get-overview.service.ts b/src/time-and-attendance/modules/time-tracker/timesheets/services/timesheet-get-overview.service.ts index e89d684..81bc330 100644 --- a/src/time-and-attendance/modules/time-tracker/timesheets/services/timesheet-get-overview.service.ts +++ b/src/time-and-attendance/modules/time-tracker/timesheets/services/timesheet-get-overview.service.ts @@ -178,11 +178,10 @@ export class GetTimesheetsOverviewService { }; } - private ensureTimesheet = async (employee_id: number, start_date: Date | string) => { - const start = toDateFromString(start_date); + private ensureTimesheet = async (employee_id: number, start_date: Date) => { let row = await this.prisma.timesheets.findFirst({ - where: { employee_id, start_date: start }, + where: { employee_id, start_date: start_date }, include: { employee: { include: { user: true } }, shift: { include: { bank_code: true } }, @@ -194,13 +193,13 @@ export class GetTimesheetsOverviewService { await this.prisma.timesheets.create({ data: { employee_id, - start_date: start, + start_date: start_date, is_approved: false }, }); row = await this.prisma.timesheets.findFirst({ - where: { employee_id, start_date: start }, + where: { employee_id, start_date: start_date }, include: { employee: { include: { user: true } }, shift: { include: { bank_code: true } },