From 928e44515211fad1f4f65ce3dc5604879bba5005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Wed, 28 Feb 2024 17:08:43 +0100 Subject: [PATCH] fix autoreporting optimistic data --- src/libs/actions/Policy.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Policy.ts b/src/libs/actions/Policy.ts index b9a2e8535b62..e1da946e81d8 100644 --- a/src/libs/actions/Policy.ts +++ b/src/libs/actions/Policy.ts @@ -392,6 +392,9 @@ function setWorkspaceAutoReporting(policyID: string, enabled: boolean) { key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, value: { autoReporting: enabled, + harvesting: { + enabled: true, + }, pendingFields: {isAutoApprovalEnabled: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}, }, }, @@ -403,7 +406,7 @@ function setWorkspaceAutoReporting(policyID: string, enabled: boolean) { key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, value: { autoReporting: !enabled, - pendingFields: {isAutoApprovalEnabled: null}, + pendingFields: {isAutoApprovalEnabled: null, harvesting: null}, }, }, ]; @@ -413,7 +416,7 @@ function setWorkspaceAutoReporting(policyID: string, enabled: boolean) { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, value: { - pendingFields: {isAutoApprovalEnabled: null}, + pendingFields: {isAutoApprovalEnabled: null, harvesting: null}, }, }, ];