mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
feat: enhance ClearanceChargesSection with file viewing and downloading capabilities
This commit is contained in:
@@ -102,8 +102,9 @@ export function ClearanceChargesTab({
|
||||
onError,
|
||||
});
|
||||
const bill = useMutation({
|
||||
mutationFn: (p: BillInput & { chargeId: string }) =>
|
||||
bookingsService.billClearanceCharge(bookingId, p.chargeId, p),
|
||||
// Body must be exactly the DTO — the API rejects unknown keys like chargeId.
|
||||
mutationFn: ({ chargeId, ...payload }: BillInput & { chargeId: string }) =>
|
||||
bookingsService.billClearanceCharge(bookingId, chargeId, payload),
|
||||
onSuccess: (next) => {
|
||||
toast.success("Charge amount saved");
|
||||
refresh(next);
|
||||
@@ -120,8 +121,8 @@ export function ClearanceChargesTab({
|
||||
onError,
|
||||
});
|
||||
const createMisc = useMutation({
|
||||
mutationFn: (p: BillInput & { file: File }) =>
|
||||
bookingsService.createMiscellaneousCharge(bookingId, p.file, p),
|
||||
mutationFn: ({ file, ...payload }: BillInput & { file: File }) =>
|
||||
bookingsService.createMiscellaneousCharge(bookingId, file, payload),
|
||||
onSuccess: (next) => {
|
||||
toast.success("Miscellaneous charge created");
|
||||
// Remount the form so the next charge starts from an empty one.
|
||||
|
||||
Reference in New Issue
Block a user