Skip to content

Commit

Permalink
UIIN-2689: Replace Promise.all with Promise.allSettled (#2348)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3170c56)
  • Loading branch information
OleksandrHladchenko1 authored and mariia-aloshyna committed Nov 24, 2023
1 parent 22da626 commit 1c6e03f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change history for ui-inventory

## [10.0.6] IN PROGRESS

* Inactive Holdings/items on Central tenant when user have affiliation for separate Member with 0 permissions. Fixes UIIN-2689.

## [10.0.5](https://github.com/folio-org/ui-inventory/tree/v10.0.5) (2023-11-22)
[Full Changelog](https://github.com/folio-org/ui-inventory/compare/v10.0.4...v10.0.5)

Expand Down
6 changes: 4 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ export const isUserInConsortiumMode = stripes => stripes.hasInterface('consortia

export const isInstanceShadowCopy = (source) => [`${CONSORTIUM_PREFIX}FOLIO`, `${CONSORTIUM_PREFIX}MARC`].includes(source);

export const getUserTenantsPermissions = (stripes, tenants = []) => {
export const getUserTenantsPermissions = async (stripes, tenants = []) => {
const {
user: { user: { id } },
okapi: {
Expand All @@ -817,7 +817,9 @@ export const getUserTenantsPermissions = (stripes, tenants = []) => {
return { tenantId, ...json };
});

return Promise.all(promises);
const userTenantsPermissions = await Promise.allSettled(promises);

return userTenantsPermissions.map(userTenantsPermission => userTenantsPermission.value);
};

export const hasMemberTenantPermission = (permissionName, tenantId, permissions = []) => {
Expand Down

0 comments on commit 1c6e03f

Please sign in to comment.