feat(tender-details): add documents section and enhance document handling

- Introduced a new documents section in the tender details page for better organization of related documents.
- Updated the API service to support downloading individual and bulk documents.
- Enhanced the TenderDetailsContent component to manage document data and loading states effectively.
- Refactored tender navigation items to include the new documents section.
- Improved type definitions for better clarity and type safety in document handling.
This commit is contained in:
AmirReza Jamali
2026-05-11 17:41:38 +03:30
parent 88bc939956
commit 2477215fce
9 changed files with 282 additions and 4 deletions
+13
View File
@@ -60,4 +60,17 @@ export const tendersService = {
throw error;
}
},
/** Single file — backend expects `filename` matching the list entry. */
downloadTenderDocument: (tenderId: string, filename: string) =>
api.get<Blob>(API_ENDPOINTS.TENDERS.DOCUMENTS_DOWNLOAD(tenderId), {
params: { filename },
responseType: "blob",
}),
/** Optional bulk archive when the API returns a zip without extra params. */
downloadTenderDocumentsArchive: (tenderId: string) =>
api.get<Blob>(API_ENDPOINTS.TENDERS.DOCUMENTS_DOWNLOAD(tenderId), {
responseType: "blob",
}),
};
+1 -1
View File
@@ -32,7 +32,7 @@ export const TenderDocumentsResponseSchema = z.object({
size: z.number(),
last_modified: z.number(),
document_type: z.string(),
})
});
export const TenderTranslationResponseSchema = z.object({
notice_id: z.string(),
language: z.string(),