summaryrefslogtreecommitdiff
path: root/makima/frontend/src/hooks/useOrders.ts
diff options
context:
space:
mode:
Diffstat (limited to 'makima/frontend/src/hooks/useOrders.ts')
-rw-r--r--makima/frontend/src/hooks/useOrders.ts14
1 files changed, 3 insertions, 11 deletions
diff --git a/makima/frontend/src/hooks/useOrders.ts b/makima/frontend/src/hooks/useOrders.ts
index 2dd20bb..9380080 100644
--- a/makima/frontend/src/hooks/useOrders.ts
+++ b/makima/frontend/src/hooks/useOrders.ts
@@ -12,7 +12,6 @@ import {
updateOrder,
deleteOrder,
linkOrderToDirective,
- linkOrderToContract,
convertOrderToStep,
} from "../lib/api";
@@ -101,16 +100,9 @@ export function useOrder(id: string | undefined) {
return o;
}, [id]);
- const linkContract = useCallback(async (contractId: string) => {
+ const convertToStep = useCallback(async () => {
if (!id) return;
- const o = await linkOrderToContract(id, contractId);
- setOrder(o);
- return o;
- }, [id]);
-
- const convertToStep = useCallback(async (directiveId: string) => {
- if (!id) return;
- const step = await convertOrderToStep(id, directiveId);
+ const step = await convertOrderToStep(id);
await refresh();
return step;
}, [id, refresh]);
@@ -118,6 +110,6 @@ export function useOrder(id: string | undefined) {
return {
order, loading, error, refresh,
update, remove,
- linkDirective, linkContract, convertToStep,
+ linkDirective, convertToStep,
};
}