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
  • Loading branch information
cristipaval authored Jun 4, 2024
2 parents 9705eff + 96a41e2 commit 92a7b15
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 92a7b15

Please sign in to comment.