From 489fb69f73e0d227ddf982f25f95babc6f99da6a Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Thu, 12 Oct 2023 10:36:20 -0400 Subject: [PATCH] fix: audit table rendering --- src/pages/Audit/index.js | 2 ++ src/store/actions/climateWarehouseActions.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/Audit/index.js b/src/pages/Audit/index.js index 14c89aa9..7bfdb644 100644 --- a/src/pages/Audit/index.js +++ b/src/pages/Audit/index.js @@ -118,6 +118,7 @@ const Audit = () => { limit: constants.MAX_AUDIT_TABLE_SIZE, useMockedResponse: false, order: newSortOrder, + storeFullResponse: true, }), ); }, [auditSortOrder, setAuditSortOrder, selectedOrgUid]); @@ -133,6 +134,7 @@ const Audit = () => { limit: constants.MAX_AUDIT_TABLE_SIZE, useMockedResponse: false, order: auditSortOrder, + storeFullResponse: true, }), ); }, diff --git a/src/store/actions/climateWarehouseActions.js b/src/store/actions/climateWarehouseActions.js index ea8e60d6..2e7311fd 100644 --- a/src/store/actions/climateWarehouseActions.js +++ b/src/store/actions/climateWarehouseActions.js @@ -65,11 +65,15 @@ export const actions = keyMirror( 'GET_TRANSFER_OFFER', ); +/* + * the option storeFullResponse means that we are storing the entire response instead of just the data object + * this is needed because there is currently an inconsistency in how the responses are managed that needs to be fixed. + */ const getClimateWarehouseTable = ( url, action, mockAction, - { useMockedResponse = false, useApiMock = false }, + { useMockedResponse = false, useApiMock = false, storeFullResponse = false }, ) => { return async dispatch => { dispatch(activateProgressIndicator); @@ -91,7 +95,8 @@ const getClimateWarehouseTable = ( if ( typeof results === 'object' && results !== null && - 'data' in results + 'data' in results && + storeFullResponse === false ) { dispatch({ type: action, @@ -2379,6 +2384,7 @@ export const getRatings = options => { export const getAudit = options => { return dispatch => { + console.log({ options }); if (options?.orgUid && options?.limit && options?.page) { dispatch( getClimateWarehouseTable(