Skip to content

Commit

Permalink
Merge pull request marmelab#3927 from marmelab/fix-missing-core-const…
Browse files Browse the repository at this point in the history
…ants

[RFR] Fix missing core constants
  • Loading branch information
djhi authored Nov 4, 2019
2 parents 6eaa991 + 26feead commit 0872558
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 deletions.
17 changes: 17 additions & 0 deletions packages/ra-core/src/core/components.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import CoreAdmin from './CoreAdmin';
import CoreAdminContext from './CoreAdminContext';
import CoreAdminRouter from './CoreAdminRouter';
import CoreAdminUI from './CoreAdminUI';
import createAdminStore from './createAdminStore';
import RoutesWithLayout from './RoutesWithLayout';
import Resource from './Resource';

export {
CoreAdmin,
CoreAdminContext,
CoreAdminRouter,
CoreAdminUI,
createAdminStore,
RoutesWithLayout,
Resource,
};
20 changes: 3 additions & 17 deletions packages/ra-core/src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
import CoreAdmin from './CoreAdmin';
import CoreAdminContext from './CoreAdminContext';
import CoreAdminRouter from './CoreAdminRouter';
import CoreAdminUI from './CoreAdminUI';
import createAdminStore from './createAdminStore';
import RoutesWithLayout from './RoutesWithLayout';
import Resource from './Resource';

export {
CoreAdmin,
CoreAdminContext,
CoreAdminRouter,
CoreAdminUI,
createAdminStore,
RoutesWithLayout,
Resource,
};
export * from './dataFetchActions';
export * from './components';
// there seems to be a bug in TypeScript: this only works if the exports are in this order.
// Swapping the two exports leads to the core module missing the dataFetchActions constants
10 changes: 6 additions & 4 deletions packages/ra-core/src/dataProvider/useDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ const performUndoableQuery = ({
warnBeforeClosingWindow
);
}
console.error(error);
return logoutIfAccessDenied(error).then(loggedOut => {
if (loggedOut) return;
dispatch({
Expand Down Expand Up @@ -354,8 +355,9 @@ const performQuery = ({
onSuccess && onSuccess(response);
return response;
})
.catch(error =>
logoutIfAccessDenied(error).then(loggedOut => {
.catch(error => {
console.error(error);
return logoutIfAccessDenied(error).then(loggedOut => {
if (loggedOut) return;
dispatch({
type: `${action}_FAILURE`,
Expand All @@ -372,8 +374,8 @@ const performQuery = ({
dispatch({ type: FETCH_ERROR, error });
onFailure && onFailure(error);
throw error;
})
);
});
});
};

interface QueryFunctionParams {
Expand Down

0 comments on commit 0872558

Please sign in to comment.