mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-04-22 20:32:24 +00:00
32 lines
695 B
JavaScript
32 lines
695 B
JavaScript
/**
|
|
* Adds a notification error if the error response has 404 status code.
|
|
*/
|
|
export function notify404(dispatch, error, title, message) {
|
|
if (error.response && error.response.status === 404) {
|
|
dispatch(
|
|
'notification/error',
|
|
{
|
|
title: title,
|
|
message: message
|
|
},
|
|
{ root: true }
|
|
)
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Adds a notification error if the response error is equal to the provided
|
|
* error code.
|
|
*/
|
|
export function notifyError(dispatch, error, error_code, title, message) {
|
|
if (error.responseError === error_code) {
|
|
dispatch(
|
|
'notification/error',
|
|
{
|
|
title: title,
|
|
message: message
|
|
},
|
|
{ root: true }
|
|
)
|
|
}
|
|
}
|