feat: customer form code abbrev

This commit is contained in:
Methapon2001 2024-08-13 12:52:25 +07:00
parent 0af5d049c3
commit 560e9dc272
5 changed files with 52 additions and 10 deletions

View file

@ -182,11 +182,6 @@ const useCustomerStore = defineStore('api-customer', () => {
const attachment = payload.customerBranch?.map((v) => v.file);
payload.customerBranch = payload.customerBranch?.map((v) => {
delete v['code'];
return { ...v };
});
if (payload.customerBranch?.length) {
for (let i = 0; i < payload.customerBranch?.length; i++) {
delete payload.customerBranch[i].file;
@ -240,7 +235,7 @@ const useCustomerStore = defineStore('api-customer', () => {
const attachment = payload.customerBranch?.map((v) => v.file);
payload.customerBranch = payload.customerBranch?.map((v) => {
const { code, ...rest } = v;
const { code: _code, ...rest } = v;
return { ...rest };
});

View file

@ -96,6 +96,7 @@ export type CustomerBranchCreate = {
};
export type CustomerCreate = {
code: string;
customerBranch?: (CustomerBranchCreate & { id?: string })[];
taxNo?: string | null;
customerNameEN: string;