Skip to content

Commit

Permalink
Merge pull request Expensify#46605 from gijoe0295/gijoe/45771
Browse files Browse the repository at this point in the history
Fix: Set GL code and clear errors for dependent tags not work
  • Loading branch information
rlinoz authored Aug 5, 2024
2 parents 4c0c160 + 65076a7 commit 98e7536
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/actions/Policy/Tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ function deletePolicyTags(policyID: string, tagsToDelete: string[]) {
}

function clearPolicyTagErrors(policyID: string, tagName: string, tagListIndex: number) {
const tagListName = Object.keys(allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`] ?? {})[tagListIndex];
const tagListName = PolicyUtils.getTagListName(allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`], tagListIndex);
const tag = allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`]?.[tagListName].tags?.[tagName];
if (!tag) {
return;
Expand Down Expand Up @@ -772,7 +772,7 @@ function setPolicyTagsRequired(policyID: string, requiresTag: boolean, tagListIn
}

function setPolicyTagGLCode(policyID: string, tagName: string, tagListIndex: number, glCode: string) {
const tagListName = Object.keys(allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`] ?? {})[tagListIndex];
const tagListName = PolicyUtils.getTagListName(allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`], tagListIndex);
const policyTagToUpdate = allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`]?.[tagListName]?.tags?.[tagName] ?? {};
const onyxData: OnyxData = {
optimisticData: [
Expand Down

0 comments on commit 98e7536

Please sign in to comment.