fix(approvals): adjustments to date changes on approval page.

This commit is contained in:
Nicolas Drolet 2025-12-29 08:54:10 -05:00
parent 097fe9db3c
commit a0ae870ef3
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ export interface User {
last_name: string;
email: string;
role: UserRole;
user_module_access: UserModuleAccess;
user_module_access: UserModuleAccess[];
}
export type UserRole = 'ADMIN' | 'SUPERVISOR' | 'HR' | 'ACCOUNTING' | 'EMPLOYEE' | 'DEALER' | 'CUSTOMER' | 'GUEST';

View File

@ -5,10 +5,10 @@ export const useTimesheetApprovalApi = () => {
const timesheet_store = useTimesheetStore();
const DATE_REGEX = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;
const getTimesheetOverviews = async () => {
const getTimesheetOverviews = async (date?: string) => {
timesheet_store.is_loading = true;
const success = await timesheet_store.getPayPeriodByDateOrYearAndNumber();
const success = await timesheet_store.getPayPeriodByDateOrYearAndNumber(date);
if (success) await timesheet_store.getTimesheetOverviews();
timesheet_store.is_loading = false;