From 536b4314f04d419f25599a06aff7662d6fa26d5d Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Mon, 28 Oct 2024 08:58:55 +0700 Subject: [PATCH] refactor: create function accepted --- src/pages/05_quotation/form.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pages/05_quotation/form.ts b/src/pages/05_quotation/form.ts index 92809a2c..be8d806d 100644 --- a/src/pages/05_quotation/form.ts +++ b/src/pages/05_quotation/form.ts @@ -234,6 +234,13 @@ export const useQuotationForm = defineStore('form-quotation', () => { cancel: () => {}, }); } + async function accepted(id: string) { + const res = await quotationStore.changeStatus(id, 'Accepted'); + if (res) { + return true; + } + return false; + } return { DEFAULT_DATA, @@ -249,6 +256,8 @@ export const useQuotationForm = defineStore('form-quotation', () => { dialogDelete, resetForm, + accepted, + submitQuotation, }; });