mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 17:00:55 +00:00
Add notification message when delete the default register role
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
61ed2ca7f1
commit
1f2e5c23c0
@ -4,6 +4,7 @@ import { Button } from '@buffetjs/core';
|
|||||||
import { List, Header } from '@buffetjs/custom';
|
import { List, Header } from '@buffetjs/custom';
|
||||||
import { Plus } from '@buffetjs/icons';
|
import { Plus } from '@buffetjs/icons';
|
||||||
import matchSorter from 'match-sorter';
|
import matchSorter from 'match-sorter';
|
||||||
|
import { get } from 'lodash';
|
||||||
import {
|
import {
|
||||||
useGlobalContext,
|
useGlobalContext,
|
||||||
useQuery,
|
useQuery,
|
||||||
@ -108,11 +109,20 @@ const RoleListPage = () => {
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
const errorIds = get(err, ['response', 'payload', 'data', 'ids'], null);
|
||||||
|
|
||||||
|
if (errorIds && Array.isArray(errorIds)) {
|
||||||
|
const errorsMsg = errorIds.join('\n');
|
||||||
|
strapi.notification.toggle({
|
||||||
|
type: 'warning',
|
||||||
|
message: errorsMsg,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
strapi.notification.toggle({
|
strapi.notification.toggle({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: { id: 'notification.error' },
|
message: { id: 'notification.error' },
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
handleToggleModal();
|
handleToggleModal();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user