Skip to content

Commit

Permalink
Merge pull request #42734 from nkdengineer/fix/42205
Browse files Browse the repository at this point in the history
Fix unable to add custom tag name in a new workspace

(cherry picked from commit 92a7b15)
  • Loading branch information
cristipaval authored and OSBotify committed Jun 4, 2024
1 parent b6c70ff commit bdb5533
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/libs/actions/Policy/Tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,27 @@ function enablePolicyTags(policyID: string, enabled: boolean) {
},
],
};
const policyTagList = allPolicyTags?.[policyID];
if (!policyTagList) {
const defaultTagList: PolicyTagList = {
Tag: {
name: 'Tag',
orderWeight: 0,
required: false,
tags: {},
},
};
onyxData.optimisticData?.push({
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`,
value: defaultTagList,
});
onyxData.failureData?.push({
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`,
value: null,
});
}

const parameters: EnablePolicyTagsParams = {policyID, enabled};

Expand Down

0 comments on commit bdb5533

Please sign in to comment.