add access to deployment

This commit is contained in:
yoan
2024-11-13 13:20:47 +08:00
parent fd04cec606
commit 52f40d982d
29 changed files with 1120 additions and 88 deletions

View File

@@ -26,6 +26,7 @@ export type WorkflowState = {
switchEnable(): void;
save(): void;
init(id?: string): void;
setBaseInfo: (name: string, description: string) => void;
};
export const useWorkflowStore = create<WorkflowState>((set, get) => ({
@@ -52,6 +53,23 @@ export const useWorkflowStore = create<WorkflowState>((set, get) => ({
initialized: true,
});
},
setBaseInfo: async (name: string, description: string) => {
const resp = await save({
id: (get().workflow.id as string) ?? "",
name: name,
description: description,
});
set((state: WorkflowState) => {
return {
workflow: {
...state.workflow,
name,
description,
id: resp.id,
},
};
});
},
switchEnable: async () => {
const resp = await save({
id: (get().workflow.id as string) ?? "",