Skip to content

Commit

Permalink
Refactor ClusterGroup to streamline cluster creation process
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Brian Joseph Petro committed Jan 22, 2025
1 parent fe46b44 commit 6f9cff9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion smart-cluster-groups/cluster_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 6f9cff9

Please sign in to comment.