fix(timesheet): removed validation/transformation from ensureTimesheet and use the param Date format inside the function
This commit is contained in:
parent
c0fbad006d
commit
9f0da467ae
|
|
@ -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 } },
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user