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:
@@ -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",
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user