From: Jason Etheridge Date: Mon, 15 May 2023 13:52:16 +0000 (-0400) Subject: boom X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7d6806bfcdb75ad6da3793e801552412c82d8490;p=working%2FEvergreen.git boom Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/custom-org-unit-trees.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/custom-org-unit-trees.component.html index a614679035..ddd48c6c05 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/custom-org-unit-trees.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/custom-org-unit-trees.component.html @@ -1,11 +1,11 @@ -Update Succeeded - +Update Succeeded + -Update Failed - +Update Failed + this.toast.success(str)); + } catch (error) { console.error('Error applying changes:', error); + this.updateFailedString.current().then(str => this.toast.danger(str)); } } async createNewNodes(node: any, parent_id: number = null, order: number = 0) { + // delete the existing custom nodes for the custom tree + // TODO: this is what the dojo interface did, but do we really need so much churn? + // TODO: we may want to move this to an OpenSRF method so we can wrap the entire + // delete and create into a single transaction + if (this.aouctn_root) { + await lastValueFrom(this.pcrud.remove(this.aouctn_root)); + this.aouctn_root = null; + } let newNode = this.idl.create('aouctn'); newNode.parent_node(parent_id); newNode.sibling_order(order); - newNode.org_unit = node.callerData.orgId; - newNode.tree = this.tree_type.id(); + newNode.org_unit(node.callerData.orgId); + newNode.tree(this.tree_type.id()); // Send the new node to the server and get back the updated node newNode = await firstValueFrom(this.pcrud.create(newNode));