feat: store it full response as source
This commit is contained in:
parent
c22dc7d945
commit
42cc0175f8
3 changed files with 5 additions and 0 deletions
|
|
@ -284,6 +284,7 @@ async function storeDataLocal(id: string) {
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
data: quotationFormData.value,
|
data: quotationFormData.value,
|
||||||
meta: {
|
meta: {
|
||||||
|
source: quotationFormState.value.source,
|
||||||
createdBy: quotationFormState.value.createdBy('tha'),
|
createdBy: quotationFormState.value.createdBy('tha'),
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -637,6 +637,7 @@ function storeDataLocal() {
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
data: quotationFormData.value,
|
data: quotationFormData.value,
|
||||||
meta: {
|
meta: {
|
||||||
|
source: quotationFormState.value.source,
|
||||||
createdBy: quotationFormState.value.createdBy('tha'),
|
createdBy: quotationFormState.value.createdBy('tha'),
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ export const useQuotationForm = defineStore('form-quotation', () => {
|
||||||
);
|
);
|
||||||
const currentFormState = ref<{
|
const currentFormState = ref<{
|
||||||
mode: null | 'info' | 'create' | 'edit';
|
mode: null | 'info' | 'create' | 'edit';
|
||||||
|
source?: QuotationFull;
|
||||||
createdBy: (locale: string) => string;
|
createdBy: (locale: string) => string;
|
||||||
}>({
|
}>({
|
||||||
mode: null,
|
mode: null,
|
||||||
|
|
@ -105,6 +106,8 @@ export const useQuotationForm = defineStore('form-quotation', () => {
|
||||||
|
|
||||||
if (!data) return; // NOTE: Error should be handled globally by axios instance
|
if (!data) return; // NOTE: Error should be handled globally by axios instance
|
||||||
|
|
||||||
|
currentFormState.value.source = data;
|
||||||
|
|
||||||
quotationFull.value = data;
|
quotationFull.value = data;
|
||||||
resetFormData = Object.assign(data, {
|
resetFormData = Object.assign(data, {
|
||||||
productServiceList: data.productServiceList.map((v) => ({
|
productServiceList: data.productServiceList.map((v) => ({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue