{role.permissions.map((permission: any) => (
-
+
))}
diff --git a/frontend/app/duck/roles.js b/frontend/app/duck/roles.js
index 139e3c29e..3015d556c 100644
--- a/frontend/app/duck/roles.js
+++ b/frontend/app/duck/roles.js
@@ -5,7 +5,7 @@ import { reduceDucks } from 'Duck/tools';
import { createListUpdater } from './funcTools/tools';
const crudDuck = crudDuckGenerator('client/role', Role, { idKey: 'roleId' });
-export const { fetchList, init, edit, remove, } = crudDuck.actions;
+export const { fetchList, init, edit, remove } = crudDuck.actions;
const RESET_ERRORS = 'roles/RESET_ERRORS';
@@ -18,23 +18,24 @@ const initialState = Map({
{ text: 'Dashboard', value: 'METRICS' },
{ text: 'Assist (Live)', value: 'ASSIST_LIVE' },
{ text: 'Assist (Call)', value: 'ASSIST_CALL' },
- ])
+ ]),
});
// const name = "role";
-const idKey = "roleId";
+const idKey = 'roleId';
const updateItemInList = createListUpdater(idKey);
-const updateInstance = (state, instance) => state.getIn([ "instance", idKey ]) === instance[ idKey ]
- ? state.mergeIn([ "instance" ], instance)
- : state;
+const updateInstance = (state, instance) =>
+ state.getIn(['instance', idKey]) === instance[idKey]
+ ? state.mergeIn(['instance'], instance)
+ : state;
const reducer = (state = initialState, action = {}) => {
switch (action.type) {
case RESET_ERRORS:
return state.setIn(['removeRequest', 'errors'], null);
case crudDuck.actionTypes.SAVE.SUCCESS:
- return updateItemInList(updateInstance(state, action.data), action.data);
+ return updateItemInList(updateInstance(state, action.data), Role(action.data));
}
return state;
};
@@ -42,14 +43,17 @@ const reducer = (state = initialState, action = {}) => {
export function save(instance) {
return {
types: crudDuck.actionTypes.SAVE.toArray(),
- call: client => instance.roleId ? client.post(`/client/roles/${ instance.roleId }`, instance.toData()) : client.put(`/client/roles`, instance.toData()),
+ call: (client) =>
+ instance.roleId
+ ? client.post(`/client/roles/${instance.roleId}`, instance.toData())
+ : client.put(`/client/roles`, instance.toData()),
};
}
export function resetErrors() {
return {
type: RESET_ERRORS,
- }
+ };
}
export default reduceDucks(crudDuck, { initialState, reducer }).reducer;
diff --git a/frontend/app/duck/site.js b/frontend/app/duck/site.js
index 08d04b70e..82fabf706 100644
--- a/frontend/app/duck/site.js
+++ b/frontend/app/duck/site.js
@@ -54,7 +54,6 @@ const reducer = (state = initialState, action = {}) => {
case FETCH_GDPR_SUCCESS:
return state.mergeIn([ 'instance', 'gdpr' ], action.data);
case success(SAVE):
- console.log(action)
const newSite = Site(action.data);
return updateItemInList(state, newSite)
.set('siteId', newSite.get('id'))