|
|
@@ -49,11 +49,17 @@ const GenerateMonthlyWorkHoursReport: React.FC<Props> = ({ 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), |
|
|
|