hot fix
This commit is contained in:
parent
f7dd2c244a
commit
b3a44dd97c
@ -188,21 +188,18 @@ class AddClientToFolderClass extends BasePage<IPropsClass, IState> {
|
|||||||
) {
|
) {
|
||||||
values["civility"] = ECivility.MALE; // TODO: should maybe be deleted later or added to the form
|
values["civility"] = ECivility.MALE; // TODO: should maybe be deleted later or added to the form
|
||||||
|
|
||||||
let customersToLink: IPutFoldersParams["office_folder_has_customers"] = [];
|
let customersToLink: IPutFoldersParams["office_folder_has_customers"] = this.state.selectedCustomers.map((customer) => {
|
||||||
|
return {
|
||||||
|
customer: { uid: customer.value },
|
||||||
|
};
|
||||||
|
}) as IPutFoldersParams["office_folder_has_customers"];
|
||||||
|
|
||||||
if (this.state.isNewClientSelected) {
|
if (this.state.isNewClientSelected) {
|
||||||
const customer: Customer = await Customers.getInstance().post({
|
const customer: Customer = await Customers.getInstance().post({
|
||||||
customer: values,
|
contact: values,
|
||||||
});
|
});
|
||||||
if (!customer.uid) return;
|
if (!customer.uid) return;
|
||||||
customersToLink = [{ customer: { uid: customer.uid } }];
|
customersToLink?.push({ customer: { uid: customer.uid } });
|
||||||
}
|
|
||||||
|
|
||||||
if (this.state.isExistingClientSelected) {
|
|
||||||
customersToLink = this.state.selectedCustomers.map((customer) => {
|
|
||||||
return {
|
|
||||||
customer: { uid: customer.value },
|
|
||||||
};
|
|
||||||
}) as IPutFoldersParams["office_folder_has_customers"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (customersToLink) {
|
if (customersToLink) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user