diff options
Diffstat (limited to 'makima/frontend/src/hooks/useDirectives.ts')
| -rw-r--r-- | makima/frontend/src/hooks/useDirectives.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/makima/frontend/src/hooks/useDirectives.ts b/makima/frontend/src/hooks/useDirectives.ts index 0453d14..7e26ec4 100644 --- a/makima/frontend/src/hooks/useDirectives.ts +++ b/makima/frontend/src/hooks/useDirectives.ts @@ -20,6 +20,7 @@ import { skipDirectiveStep, updateDirectiveGoal, cleanupDirectiveTasks, + pickUpOrders as pickUpOrdersApi, } from "../lib/api"; export function useDirectives() { @@ -177,11 +178,19 @@ export function useDirective(id: string | undefined) { await refresh(); }, [id, refresh]); + const pickUpOrdersFn = useCallback(async () => { + if (!id) return null; + const result = await pickUpOrdersApi(id); + await refresh(); + return result; + }, [id, refresh]); + return { directive, loading, error, refresh, update, addStep, removeStep, start, pause, advance, completeStep, failStep, skipStep, updateGoal, cleanupTasks, + pickUpOrders: pickUpOrdersFn, }; } |
