Fake role list

Signed-off-by: HichamELBSI <elabbassih@gmail.com>
This commit is contained in:
HichamELBSI 2020-05-27 17:18:48 +02:00 committed by Alexandre Bodin
parent f7f3843916
commit e6ee2c2b12
2 changed files with 26 additions and 2 deletions

View File

@ -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');

View File

@ -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,
};