Skip to content

Commit

Permalink
fix(core): 📝 menu genration missing
Browse files Browse the repository at this point in the history
rolePermission api response menu generation in menuReducer

Ref #183
  • Loading branch information
techoneel committed Mar 20, 2024
1 parent f39b8ce commit f9f8aaf
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions package/store/reducers/menuReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ const menuReducer = (state = initState, action) => {
let data = [];

if (action?.payload?.data?.permissions) {
data = action.payload.data.permissions;
// .map((rp) => {
// var ob = {
// id: rp.id,
// permissionId: rp?.Permission?.id,
// link: rp?.Permission?.link,
// label: rp?.Permission?.name,
// icon: rp?.Permission?.icon,
// children: [],
// };
// return ob;
// });
data = action.payload.data.permissions.map((rolePermission) => {
return {
children : [],
icon : rolePermission?.Permission?.icon,
id : rolePermission.id,
label : rolePermission?.Permission?.name,
link : rolePermission?.Permission?.link,
permissionId: rolePermission?.Permission?.id,
};
});
}
return {
...state,
Expand Down

0 comments on commit f9f8aaf

Please sign in to comment.