From d2122bc79b62a401d7d8499a430854b8973e1ec1 Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Tue, 31 Oct 2023 15:57:11 +0100 Subject: [PATCH] Refactor import of lodash merge function --- src/libs/actions/PersistedRequests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/PersistedRequests.ts b/src/libs/actions/PersistedRequests.ts index 59959318d0eb..87881d610d14 100644 --- a/src/libs/actions/PersistedRequests.ts +++ b/src/libs/actions/PersistedRequests.ts @@ -1,5 +1,5 @@ -import {merge} from 'lodash'; import isEqual from 'lodash/isEqual'; +import lodashMerge from 'lodash/merge'; import Onyx, {OnyxUpdate} from 'react-native-onyx'; import ONYXKEYS from '@src/ONYXKEYS'; import {Request} from '@src/types/onyx'; @@ -41,7 +41,7 @@ function createUpdatedRequest(oldRequest: Request, newRequest: Request): Request * In order to create updated request, properties: data, failureData, successData and optimisticData have to be merged */ const updatedRequest = { - data: merge({...oldRequest.data}, newRequest.data), + data: lodashMerge({...oldRequest.data}, newRequest.data), failureData: mergeOnyxUpdateData(oldRequest.failureData, newRequest.failureData), successData: mergeOnyxUpdateData(oldRequest.successData, newRequest.successData), ...newRequest,