Skip to content

Commit

Permalink
change warning type to error
Browse files Browse the repository at this point in the history
  • Loading branch information
JinParc committed Dec 20, 2022
1 parent b513bf2 commit 6bc8549
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/simple/src/posts/ResetViewsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ResetViewsButton = ({ resource, selectedIds }) => {
typeof error === 'string'
? error
: error.message || 'ra.notification.http_error',
{ type: 'warning' }
{ type: 'error' }
),
mutationMode: 'undoable',
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/auth/useCheckAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const useCheckAuth = (): CheckAuth => {
!shouldSkipNotify &&
notify(
getErrorMessage(error, 'ra.auth.auth_check_error'),
{ type: 'warning' }
{ type: 'error' }
);
}
throw error;
Expand Down
4 changes: 2 additions & 2 deletions packages/ra-core/src/auth/useLogoutIfAccessDenied.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ const useLogoutIfAccessDenied = (): LogoutIfAccessDenied => {
e,
'ra.notification.logged_out'
),
{ type: 'warning' }
{ type: 'error' }
);
} else {
notify(
getErrorMessage(
e,
'ra.notification.not_authorized'
),
{ type: 'warning' }
{ type: 'error' }
);
}
})
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/form/useNotifyIsFormInvalid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useNotifyIsFormInvalid = (control?: Control) => {
submitCountRef.current = submitCount;

if (Object.keys(errors).length > 0) {
notify('ra.message.invalid_form', { type: 'warning' });
notify('ra.message.invalid_form', { type: 'error' });
}
}
}, [errors, submitCount, notify]);
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/i18n/I18nContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const I18nContextProvider = ({
})
.catch(error => {
setInitialized(true);
notify('ra.notification.i18n_error', { type: 'warning' });
notify('ra.notification.i18n_error', { type: 'error' });
console.error(error);
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/ExportButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const ExportButton = (props: ExportButtonProps) => {
)
.catch(error => {
console.error(error);
notify('ra.notification.http_error', { type: 'warning' });
notify('ra.notification.http_error', { type: 'error' });
});
if (typeof onClick === 'function') {
onClick(event);
Expand Down

0 comments on commit 6bc8549

Please sign in to comment.