Skip to content

Commit

Permalink
fix: audit table rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Oct 12, 2023
1 parent 29aca01 commit 489fb69
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/pages/Audit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const Audit = () => {
limit: constants.MAX_AUDIT_TABLE_SIZE,
useMockedResponse: false,
order: newSortOrder,
storeFullResponse: true,
}),
);
}, [auditSortOrder, setAuditSortOrder, selectedOrgUid]);
Expand All @@ -133,6 +134,7 @@ const Audit = () => {
limit: constants.MAX_AUDIT_TABLE_SIZE,
useMockedResponse: false,
order: auditSortOrder,
storeFullResponse: true,
}),
);
},
Expand Down
10 changes: 8 additions & 2 deletions src/store/actions/climateWarehouseActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -91,7 +95,8 @@ const getClimateWarehouseTable = (
if (
typeof results === 'object' &&
results !== null &&
'data' in results
'data' in results &&
storeFullResponse === false
) {
dispatch({
type: action,
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 489fb69

Please sign in to comment.