Skip to content

Commit

Permalink
Merge pull request #46176 from etCoderDysto/gl-gray-out
Browse files Browse the repository at this point in the history
fix: Toggle, GL code & Payroll code are no longer grayed out after renaming category
  • Loading branch information
iwiznia authored Aug 5, 2024
2 parents 3580ec4 + f96a4ed commit afa7d0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libs/actions/Policy/Category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ function createPolicyCategory(policyID: string, categoryName: string) {
}

function renamePolicyCategory(policyID: string, policyCategory: {oldName: string; newName: string}) {
const policyCategoryToUpdate = allPolicyCategories?.[`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`]?.[policyCategory.oldName] ?? {};
const policyCategoryToUpdate = allPolicyCategories?.[`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`]?.[policyCategory.oldName];

const onyxData: OnyxData = {
optimisticData: [
Expand All @@ -281,6 +281,7 @@ function renamePolicyCategory(policyID: string, policyCategory: {oldName: string
name: policyCategory.newName,
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
pendingFields: {
...(policyCategoryToUpdate?.pendingFields ?? {}),
name: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},
previousCategoryName: policyCategory.oldName,
Expand All @@ -300,6 +301,7 @@ function renamePolicyCategory(policyID: string, policyCategory: {oldName: string
errors: null,
pendingAction: null,
pendingFields: {
...(policyCategoryToUpdate?.pendingFields ?? {}),
name: null,
},
},
Expand Down

0 comments on commit afa7d0c

Please sign in to comment.