From 6f9cff9a2633e49bb5367c3e01d0820a73400191 Mon Sep 17 00:00:00 2001 From: Brian Joseph Petro Date: Wed, 22 Jan 2025 10:32:32 -0500 Subject: [PATCH] Refactor ClusterGroup to streamline cluster creation process - Updated the `create_or_update` method in the ClusterGroup class to set the `key` property to null and include the clusters in the new data object. This change enhances the clarity of the data being processed during cluster group creation or update, ensuring that unnecessary properties are omitted while maintaining essential information. --- smart-cluster-groups/cluster_group.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/smart-cluster-groups/cluster_group.js b/smart-cluster-groups/cluster_group.js index e1e76b8e..13a74c37 100644 --- a/smart-cluster-groups/cluster_group.js +++ b/smart-cluster-groups/cluster_group.js @@ -113,7 +113,8 @@ export class ClusterGroup extends CollectionItem { acc[key] = value; return acc; }, new_clusters); - const new_group = await this.env.cluster_groups.create_or_update({ ...this.data, clusters }); + const new_data = { ...this.data, key: null, clusters }; + const new_group = await this.env.cluster_groups.create_or_update(new_data); return new_group; }