chore: error checking condition !=200 is moved to >=400

This commit is contained in:
Palash gupta 2022-05-13 10:43:26 +05:30
parent 574088ad54
commit a34dbc4942
No known key found for this signature in database
GPG Key ID: 8FD05AE6F9150AD6

View File

@ -15,7 +15,7 @@ function ListAlertRules(): JSX.Element {
});
useEffect(() => {
if (status === 'error' || (status === 'success' && data.statusCode !== 200)) {
if (status === 'error' || (status === 'success' && data.statusCode >= 400)) {
notification.error({
message: data?.error || t('something_went_wrong'),
});
@ -28,7 +28,7 @@ function ListAlertRules(): JSX.Element {
}
// api is successful but error is present
if (status === 'success' && data.statusCode !== 200) {
if (status === 'success' && data.statusCode >= 400) {
return (
<ListAlert
{...{