diff --git a/src/app/(main)/settings/changepassword/page.tsx b/src/app/(main)/changepassword/page.tsx similarity index 100% rename from src/app/(main)/settings/changepassword/page.tsx rename to src/app/(main)/changepassword/page.tsx diff --git a/src/app/api/reports/index.ts b/src/app/api/reports/index.ts index 555adbd..32e9cee 100644 --- a/src/app/api/reports/index.ts +++ b/src/app/api/reports/index.ts @@ -46,7 +46,7 @@ export interface ProjectPotentialDelayReportRequest { // - Monthly Work Hours Report export interface MonthlyWorkHoursReportFilter { staff: string[]; - date: any; + date: string; } export interface MonthlyWorkHoursReportRequest { diff --git a/src/app/api/staff/actions.ts b/src/app/api/staff/actions.ts index fca9727..1ee9eb4 100644 --- a/src/app/api/staff/actions.ts +++ b/src/app/api/staff/actions.ts @@ -20,17 +20,17 @@ export interface CreateStaffInputs { companyId: number; salaryId: number; skillSetId?: number[]; - joinDate: string; + joinDate?: string; currentPositionId: number; - joinPositionId: number; + joinPositionId?: number; gradeId?: number; teamId?: number - departmentId: number; + departmentId?: number; phone1: string; phone2?: string; email: string; - emergContactName: string; - emergContactPhone: string; + emergContactName?: string; + emergContactPhone?: string; employType: string; departDate?: string; departReason?: string; diff --git a/src/components/AppBar/Profile.tsx b/src/components/AppBar/Profile.tsx index 9fbe8e5..79d116d 100644 --- a/src/components/AppBar/Profile.tsx +++ b/src/components/AppBar/Profile.tsx @@ -63,7 +63,7 @@ const Profile: React.FC = ({ avatarImageSrc, profileName }) => { {profileName} - { router.replace("/settings/changepassword") }}>{t("Change Password")} + { router.replace("/changepassword") }}>{t("Change Password")} {language === "zh" && { onLangClick("en") }}>{t("Change To English Version")}} {language === "en" && { onLangClick("zh") }}>{t("Change To Chinese Version")}} signOut()}>{t("Sign out")} diff --git a/src/components/GenerateMonthlyWorkHoursReport/GenerateMonthlyWorkHoursReport.tsx b/src/components/GenerateMonthlyWorkHoursReport/GenerateMonthlyWorkHoursReport.tsx index c5bffe3..34c7c61 100644 --- a/src/components/GenerateMonthlyWorkHoursReport/GenerateMonthlyWorkHoursReport.tsx +++ b/src/components/GenerateMonthlyWorkHoursReport/GenerateMonthlyWorkHoursReport.tsx @@ -49,11 +49,17 @@ const GenerateMonthlyWorkHoursReport: React.FC = ({ staffs }) => { formType={"download"} criteria={searchCriteria} onSearch={async (query: any) => { + console.log(query); const index = staffCombo.findIndex((staff) => staff === query.staff); - const response = await fetchMonthlyWorkHoursReport({ + let postData = { id: staffs[index].id, - yearMonth: query.date, - }); + yearMonth: dayjs().format("YYYY-MM").toString(), + }; + console.log(query.date.length > 0) + if (query.date.length > 0) { + postData.yearMonth = query.date + } + const response = await fetchMonthlyWorkHoursReport(postData); if (response) { downloadFile( new Uint8Array(response.blobValue),