mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 07:33:17 +00:00
Fake role list
Signed-off-by: HichamELBSI <elabbassih@gmail.com>
This commit is contained in:
parent
f7f3843916
commit
e6ee2c2b12
@ -17,7 +17,11 @@ const useRolesList = () => {
|
||||
|
||||
dispatch({
|
||||
type: 'GET_DATA_SUCCEEDED',
|
||||
data,
|
||||
// TODO : TEMP => Uncomment after role creation is done.
|
||||
// data,
|
||||
|
||||
// TODO : TEMP => Remove after role creation is done.
|
||||
data: data.length > 0 ? data : initialState.roles,
|
||||
});
|
||||
} catch (err) {
|
||||
const message = get(err, ['response', 'payload', 'message'], 'An error occured');
|
||||
|
||||
@ -2,7 +2,27 @@
|
||||
import produce from 'immer';
|
||||
|
||||
export const initialState = {
|
||||
roles: [],
|
||||
// TODO : TEMP => Remove after role creation is done.
|
||||
roles: [
|
||||
{
|
||||
id: 1,
|
||||
name: 'Super admin',
|
||||
description: 'This is the fake description of the super admin role.',
|
||||
users: [1],
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'Editor',
|
||||
description:
|
||||
'This is the fake description of the editor role. This is the fake description of the editor role.',
|
||||
users: [7, 2, 3, 4],
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'Author',
|
||||
users: [5, 34],
|
||||
},
|
||||
],
|
||||
isLoading: true,
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user