Skip to content

Commit

Permalink
fix: set gl code and clear errors for depedant tags list not work
Browse files Browse the repository at this point in the history
  • Loading branch information
gijoe0295 committed Jul 31, 2024
1 parent bb9f0aa commit 65076a7
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 65076a7

Please sign in to comment.