From 7d2079d7c13804766405af8044574bfc93a86897 Mon Sep 17 00:00:00 2001 From: soryu Date: Mon, 16 Feb 2026 15:45:42 +0000 Subject: Add PR button to directives --- makima/frontend/src/hooks/useDirectives.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'makima/frontend/src/hooks/useDirectives.ts') 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, }; } -- cgit v1.2.3