wip
This commit is contained in:
parent
2bdc8a7e05
commit
bdd65be688
@ -39,7 +39,7 @@ export type IPutFoldersParams = {
|
||||
archived_description?: OfficeFolder["archived_description"];
|
||||
status?: OfficeFolder["status"];
|
||||
office_folder_has_stakeholder?: OfficeFolder["office_folder_has_stakeholder"];
|
||||
OfficeFolderHasCustomer?: { customer: { uid: Customer["uid"] } }[];
|
||||
office_folder_has_customers?: { customer: { uid: Customer["uid"] } }[];
|
||||
};
|
||||
|
||||
@Service()
|
||||
|
@ -148,13 +148,16 @@ class AddClientToFolderClass extends BasePage<IPropsClass, IState> {
|
||||
|
||||
console.log("SELECTD >>>", this.props.selectedFolderUid);
|
||||
const newCustomerCreated: Customer = await Customers.getInstance().post(customer);
|
||||
console.log("NEW CUSTOMER CREATED >>>", newCustomerCreated);
|
||||
|
||||
if (newCustomerCreated) {
|
||||
const query = {
|
||||
OfficeFolderHasCustomer: [{ customer: { uid: newCustomerCreated.uid } }],
|
||||
const body = {
|
||||
office_folder_has_customers: [{ customer: { uid: newCustomerCreated.uid } }],
|
||||
};
|
||||
|
||||
await Folders.getInstance().put(this.props.selectedFolderUid, query);
|
||||
console.log("BODY >>>", body);
|
||||
|
||||
await Folders.getInstance().put(this.props.selectedFolderUid, body);
|
||||
this.props.router.push(`/folders/${this.props.selectedFolderUid}`);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user