From d3ada5bfc09dde810411c46f71bf93caf4156fef Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sat, 23 Mar 2024 20:21:44 +0800 Subject: [PATCH] get the old tag data correctly --- src/libs/actions/Policy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Policy.ts b/src/libs/actions/Policy.ts index ef5a09483c67..f16b2e772a87 100644 --- a/src/libs/actions/Policy.ts +++ b/src/libs/actions/Policy.ts @@ -3114,7 +3114,7 @@ function clearPolicyTagErrors(policyID: string, tagName: string) { function renamePolicyTag(policyID: string, policyTag: {oldName: string; newName: string}) { const tagListName = Object.keys(allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`] ?? {})[0]; - const oldTag = allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`]?.[policyTag.oldName] ?? {}; + const oldTag = allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`]?.[tagListName]?.tags?.[policyTag.oldName] ?? {}; const onyxData: OnyxData = { optimisticData: [ {