fix transi permit file upload

This commit is contained in:
marshal
2026-07-02 12:22:07 +03:00
parent 4fefe4f827
commit 56bb75c9a8
9 changed files with 271 additions and 123 deletions

View File

@@ -319,9 +319,14 @@ export const contractsService = {
finalizeExportClearance: (id: string) =>
postContract<Freight.IContract>(C.CLEARANCE_FINALIZE_EXPORT(id)),
uploadTransportDocument: async (bookingId: string, file: File) => {
uploadTransportDocument: async (
bookingId: string,
files: Record<string, File | null>,
) => {
const form = new FormData();
form.append("file", file);
for (const [key, file] of Object.entries(files)) {
if (file) form.append(key, file);
}
const response = await client.post(C.BOOKING_TRANSPORT_DOCUMENT(bookingId), form, {
headers: { "Content-Type": "multipart/form-data" },
});