feat: accept debit note store

This commit is contained in:
Methapon2001 2025-02-24 13:13:43 +07:00
parent 44aed63677
commit c64676b34c

View file

@ -61,6 +61,12 @@ export async function deleteDebitNote(id: string) {
return null;
}
export async function acceptDebitNote(id: string) {
const res = await api.post<Data>(`/${ENDPOINT}/${id}/accept`);
if (res.status < 400) return res.data;
return null;
}
export const useDebitNote = defineStore('debit-note-store', () => {
const data = ref<Data[]>([]);
const page = ref<number>(1);
@ -87,6 +93,8 @@ export const useDebitNote = defineStore('debit-note-store', () => {
updateDebitNote,
deleteDebitNote,
action: { acceptDebitNote },
...manageAttachment(api, ENDPOINT),
...manageFile<'slip'>(api, ENDPOINT),
};