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