fix: type

This commit is contained in:
Methapon Metanipat 2024-10-24 14:08:23 +07:00
parent 9fdb85f1bc
commit f8673082c7

View file

@ -2,7 +2,7 @@ import { ref } from 'vue';
import { defineStore } from 'pinia';
import { api } from 'src/boot/axios';
import { PaginationResult } from 'src/types';
import { WorkflowTemplate } from './types';
import { WorkflowTemplate, WorkflowTemplatePayload } from './types';
export const useWorkflowTemplate = defineStore('workkflow-store', () => {
const data = ref<WorkflowTemplate[]>([]);
@ -32,7 +32,9 @@ export const useWorkflowTemplate = defineStore('workkflow-store', () => {
return res.data;
}
async function editWorkflowTemplate(data: WorkflowTemplate & { id: string }) {
async function editWorkflowTemplate(
data: WorkflowTemplatePayload & { id: string },
) {
const res = await api.put<WorkflowTemplate>(
`/workflow-template/${data.id}`,
{
@ -45,7 +47,7 @@ export const useWorkflowTemplate = defineStore('workkflow-store', () => {
}
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;
return res;
}