diff options
| author | soryu <soryu@soryu.co> | 2026-02-16 15:45:42 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-02-16 15:45:42 +0000 |
| commit | 7d2079d7c13804766405af8044574bfc93a86897 (patch) | |
| tree | 05212cb5cd472eff75ed54b9805a1d6ef5c7d922 /makima/frontend/src/hooks/useDirectives.ts | |
| parent | 29ec8e53f2acf56fe4a2cd02d352144c697a6afc (diff) | |
| download | soryu-7d2079d7c13804766405af8044574bfc93a86897.tar.gz soryu-7d2079d7c13804766405af8044574bfc93a86897.zip | |
Add PR button to directives
Diffstat (limited to 'makima/frontend/src/hooks/useDirectives.ts')
| -rw-r--r-- | makima/frontend/src/hooks/useDirectives.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/makima/frontend/src/hooks/useDirectives.ts b/makima/frontend/src/hooks/useDirectives.ts index 7e26ec4..18544da 100644 --- a/makima/frontend/src/hooks/useDirectives.ts +++ b/makima/frontend/src/hooks/useDirectives.ts @@ -21,6 +21,7 @@ import { updateDirectiveGoal, cleanupDirectiveTasks, pickUpOrders as pickUpOrdersApi, + createDirectivePR, } from "../lib/api"; export function useDirectives() { @@ -185,6 +186,12 @@ export function useDirective(id: string | undefined) { return result; }, [id, refresh]); + const createPR = useCallback(async () => { + if (!id) return; + await createDirectivePR(id); + await refresh(); + }, [id, refresh]); + return { directive, loading, error, refresh, update, addStep, removeStep, @@ -192,5 +199,6 @@ export function useDirective(id: string | undefined) { completeStep, failStep, skipStep, updateGoal, cleanupTasks, pickUpOrders: pickUpOrdersFn, + createPR, }; } |
