refactor(04 flow): type and create function
This commit is contained in:
parent
6f887edd42
commit
b0cb6061af
2 changed files with 8 additions and 0 deletions
|
|
@ -32,6 +32,12 @@ export const useWorkflowTemplate = defineStore('workkflow-store', () => {
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function creatWorkflowTemplate(data: WorkflowTemplatePayload) {
|
||||||
|
const res = await api.post<WorkflowTemplate>('/workflow-template', data);
|
||||||
|
if (res.status >= 400) return null;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
async function editWorkflowTemplate(
|
async function editWorkflowTemplate(
|
||||||
data: WorkflowTemplatePayload & { id: string },
|
data: WorkflowTemplatePayload & { id: string },
|
||||||
) {
|
) {
|
||||||
|
|
@ -60,6 +66,7 @@ export const useWorkflowTemplate = defineStore('workkflow-store', () => {
|
||||||
|
|
||||||
getWorkflowTemplate,
|
getWorkflowTemplate,
|
||||||
getWorkflowTemplateList,
|
getWorkflowTemplateList,
|
||||||
|
creatWorkflowTemplate,
|
||||||
editWorkflowTemplate,
|
editWorkflowTemplate,
|
||||||
deleteWorkflowTemplate,
|
deleteWorkflowTemplate,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ export type WorkflowTemplate = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export type WorkflowTemplatePayload = {
|
export type WorkflowTemplatePayload = {
|
||||||
|
registeredBranchId?: string;
|
||||||
name: string;
|
name: string;
|
||||||
step: {
|
step: {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue