Skip to content

Commit

Permalink
check for new groups added to the tag
Browse files Browse the repository at this point in the history
check for new groups added to the tag
  • Loading branch information
previnWong committed Jan 25, 2025
1 parent b57c575 commit dc4aa4c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/creator/src/creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,20 @@ export async function _updateCreateOptionForReDeployedTemplate(
.filter((item: any) => item.status === "fulfilled")
.map((item: any) => item.value.id);

//check if any new groups were made and store in the tag
const newGroups = itemBase.tags.filter((str) => str.includes("group.")).map((str) => str.split(".")[1]);

if (newGroups.length > 0) {
newGroups.forEach((groupId) => {
// If id does not already exist, push it to createOptions, itemids list.
if (!createOptions.itemIds.includes(groupId)) {
createOptions.itemIds.push(groupId);
}
});
}

//query the folder for new items
try {
//query the folder
const response = await searchItems({
q: `ownerfolder:${itemBase.ownerFolder}`,
authentication: authentication,
Expand Down

0 comments on commit dc4aa4c

Please sign in to comment.