fix: type
This commit is contained in:
parent
9fdb85f1bc
commit
f8673082c7
1 changed files with 5 additions and 3 deletions
|
|
@ -2,7 +2,7 @@ import { ref } from 'vue';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { api } from 'src/boot/axios';
|
import { api } from 'src/boot/axios';
|
||||||
import { PaginationResult } from 'src/types';
|
import { PaginationResult } from 'src/types';
|
||||||
import { WorkflowTemplate } from './types';
|
import { WorkflowTemplate, WorkflowTemplatePayload } from './types';
|
||||||
|
|
||||||
export const useWorkflowTemplate = defineStore('workkflow-store', () => {
|
export const useWorkflowTemplate = defineStore('workkflow-store', () => {
|
||||||
const data = ref<WorkflowTemplate[]>([]);
|
const data = ref<WorkflowTemplate[]>([]);
|
||||||
|
|
@ -32,7 +32,9 @@ export const useWorkflowTemplate = defineStore('workkflow-store', () => {
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editWorkflowTemplate(data: WorkflowTemplate & { id: string }) {
|
async function editWorkflowTemplate(
|
||||||
|
data: WorkflowTemplatePayload & { id: string },
|
||||||
|
) {
|
||||||
const res = await api.put<WorkflowTemplate>(
|
const res = await api.put<WorkflowTemplate>(
|
||||||
`/workflow-template/${data.id}`,
|
`/workflow-template/${data.id}`,
|
||||||
{
|
{
|
||||||
|
|
@ -45,7 +47,7 @@ export const useWorkflowTemplate = defineStore('workkflow-store', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteWorkflowTemplate(id: string) {
|
async function deleteWorkflowTemplate(id: string) {
|
||||||
const res = await api.delete(`/workflow-template/${id}`);
|
const res = await api.delete<WorkflowTemplate>(`/workflow-template/${id}`);
|
||||||
if (res.status >= 400) return null;
|
if (res.status >= 400) return null;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue