changes
This commit is contained in:
@@ -413,7 +413,7 @@ async function update() {
|
||||
|
||||
let res = isNewCustomer.value
|
||||
? await $insertapi("customer", { data: customerData, notify: false })
|
||||
: await $patchapi("customer", customerData, undefined, false);
|
||||
: await $patchapi("customer", { data: customerData, notify: false });
|
||||
if (!res || res === "error") return;
|
||||
|
||||
const customerId = res.id;
|
||||
@@ -423,14 +423,20 @@ async function update() {
|
||||
let indPayload = $resetNull({ ...individualData.value });
|
||||
indPayload.customer = customerId;
|
||||
if (individualData.value.id)
|
||||
await $patchapi("individual", { ...indPayload, id: individualData.value.id }, undefined, false);
|
||||
await $patchapi("individual", {
|
||||
data: { ...indPayload, id: individualData.value.id },
|
||||
notify: false,
|
||||
});
|
||||
else await $insertapi("individual", { data: indPayload, notify: false });
|
||||
} else if (isOrganization.value) {
|
||||
let orgPayload = $resetNull({ ...organizationData.value });
|
||||
orgPayload.customer = customerId;
|
||||
let orgRes;
|
||||
if (organizationData.value.id) {
|
||||
orgRes = await $patchapi("organization", { ...orgPayload, id: organizationData.value.id }, undefined, false);
|
||||
orgRes = await $patchapi("organization", {
|
||||
data: { ...orgPayload, id: organizationData.value.id },
|
||||
notify: false,
|
||||
});
|
||||
} else {
|
||||
orgRes = await $insertapi("organization", { data: orgPayload, notify: false });
|
||||
}
|
||||
@@ -459,7 +465,7 @@ async function update() {
|
||||
const payload = { ...lp, ...commonPayload };
|
||||
|
||||
if (!match) {
|
||||
$patchapi(apiName, payload);
|
||||
$patchapi(apiName, { data: payload });
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user