mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-06 08:53:39 +00:00
Merge pull request #1461 from Tria-plc/freight_feature/usermanagement
feat(contracts): implement staff cancellation of contracts with reaso…
This commit is contained in:
@@ -151,6 +151,14 @@ export function useContractMutations(contractId: string) {
|
||||
onError: (error) => toast.error(extractErrorMessage(error, "Failed to reject contract")),
|
||||
});
|
||||
|
||||
const cancelByStaff = useMutation({
|
||||
mutationFn: (reason: string) =>
|
||||
contractsService.cancelByStaff(contractId, reason),
|
||||
onSuccess: (data) => onSuccess(data, "Contract cancelled"),
|
||||
onError: (error) =>
|
||||
toast.error(extractErrorMessage(error, "Failed to cancel contract")),
|
||||
});
|
||||
|
||||
const suspend = useMutation({
|
||||
mutationFn: (reason: string) => contractsService.suspend(contractId, reason),
|
||||
onSuccess: (data) => onSuccess(data, "Contract suspended"),
|
||||
@@ -269,6 +277,7 @@ export function useContractMutations(contractId: string) {
|
||||
updateDocument,
|
||||
requestChanges,
|
||||
reject,
|
||||
cancelByStaff,
|
||||
suspend,
|
||||
resume,
|
||||
approveStep,
|
||||
|
||||
Reference in New Issue
Block a user