|
|
@@ -43,13 +43,13 @@ const GenFinancialStatusReport: React.FC<Props> = ({ projects, teamCombo }) => { |
|
|
|
if (query.code.length > 0 && query.code.toLocaleLowerCase() !== "all") { |
|
|
|
const projectIndex = teamCombo.findIndex((project) => `${project.code} - ${project.name}` === query.code) |
|
|
|
console.log(teamCombo[projectIndex].id) |
|
|
|
const response = await fetchProjectsFinancialStatusReport({ projectId: projects[projectIndex].id }) |
|
|
|
const response = await fetchProjectsFinancialStatusReport({ teamLeadId: projects[projectIndex].id }) |
|
|
|
if (response) { |
|
|
|
downloadFile(new Uint8Array(response.blobValue), response.filename!!) |
|
|
|
} |
|
|
|
}else{ |
|
|
|
console.log(query.code) |
|
|
|
const response = await fetchProjectsFinancialStatusReport({ projectId: -1 }) |
|
|
|
const response = await fetchProjectsFinancialStatusReport({ teamLeadId: -1 }) |
|
|
|
if (response) { |
|
|
|
downloadFile(new Uint8Array(response.blobValue), response.filename!!) |
|
|
|
} |
|
|
|