Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: When calling getPermissions api duplicate permissionIds are passed in the payload(#211) #253

Merged
merged 2 commits into from
Feb 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ const actions: ActionTree<UserState, RootState> = {
const permissionId = process.env.VUE_APP_PERMISSION_ID;
// Prepare permissions list
const serverPermissionsFromRules = getServerPermissionsFromRules();
if (permissionId) serverPermissionsFromRules.push(permissionId);

const removeDuplicatePermissionIds = new Set(serverPermissionsFromRules)
removeDuplicatePermissionIds.add(permissionId);

const serverPermissions = await UserService.getUserPermissions({
permissionIds: serverPermissionsFromRules
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove the above code to create set.

Suggested change
permissionIds: serverPermissionsFromRules
permissionIds: [...new Set(serverPermissionsFromRules)]

Expand Down
Loading