fix(pay-period): minor fix to pay period handling, was returning pay-year of date from request rather than pay-year from pay period in db
This commit is contained in:
parent
6f3acde71b
commit
0c77df41c6
|
|
@ -12,7 +12,8 @@ export function mapPayPeriodToDto(row: PayPeriods): PayPeriodDto {
|
||||||
period_start: toDateString(row.period_start),
|
period_start: toDateString(row.period_start),
|
||||||
period_end: toDateString(row.period_end),
|
period_end: toDateString(row.period_end),
|
||||||
payday:pay,
|
payday:pay,
|
||||||
pay_year: new Date(pay).getFullYear(),
|
// pay_year: new Date(pay).getFullYear(),
|
||||||
|
pay_year: row.pay_year,
|
||||||
label: `${start}.${end}`,
|
label: `${start}.${end}`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ export class SchedulePresetsGetService {
|
||||||
orderBy: [{ is_default: 'desc' }, { name: 'asc' }],
|
orderBy: [{ is_default: 'desc' }, { name: 'asc' }],
|
||||||
include: {
|
include: {
|
||||||
shifts: {
|
shifts: {
|
||||||
orderBy: [{ week_day: 'asc', start_time: 'asc' }],
|
orderBy: [{ week_day: 'asc'}, {start_time: 'asc' }],
|
||||||
include: { bank_code: { select: { type: true } } },
|
include: { bank_code: { select: { type: true } } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -38,6 +38,7 @@ export class SchedulePresetsGetService {
|
||||||
type: shift.bank_code?.type,
|
type: shift.bank_code?.type,
|
||||||
})),
|
})),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return { success: true, data: response };
|
return { success: true, data: response };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return { success: false, error: `SCHEDULE_PRESET_NOT_FOUND` };
|
return { success: false, error: `SCHEDULE_PRESET_NOT_FOUND` };
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user