Browse Source

Update request

tags/Baseline_30082024_FRONTEND_UAT
MSI\2Fi 1 year ago
parent
commit
47823350dd
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      src/app/api/reporte1/action.ts
  2. +2
    -2
      src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx

+ 1
- 1
src/app/api/reporte1/action.ts View File

@@ -10,7 +10,7 @@ export interface FileResponse {
}

export interface FinancialStatusReportRequest {
projectId: number;
teamLeadId: number;
}

export const fetchProjectsFinancialStatusReport = async (data: FinancialStatusReportRequest) => {


+ 2
- 2
src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx View File

@@ -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!!)
}


Loading…
Cancel
Save