Skip to content

Commit

Permalink
UISACQCOMP-170 Optimize acquisition memberships query to improve perf…
Browse files Browse the repository at this point in the history
…ormance (#735)
  • Loading branch information
usavkov-epam authored Nov 28, 2023
1 parent 895016c commit 425a3ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Added `indexRef` and `inputRef` props to `<SingleSearchForm>`. Refs UISACQCOMP-167.
* Extend Donors component functionality. Refs UISACQCOMP-168.
* Add Donors Filter component. Refs UISACQCOMP-169.
* Optimize acquisition memberships query to improve performance. Refs UISACQCOMP-170.

## [5.0.0](https://github.com/folio-org/stripes-acq-components/tree/v5.0.0) (2023-10-12)
[Full Changelog](https://github.com/folio-org/stripes-acq-components/compare/v4.0.2...v5.0.0)
Expand Down
4 changes: 2 additions & 2 deletions lib/AcqUnits/hooks/useAcqRestrictions/useAcqRestrictions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ const useAcqMemberships = (entityId, acqUnits = []) => {
const stripes = useStripes();
const userId = stripes.user?.user?.id;

const acqUnitsQuery = acqUnits.map(id => `acquisitionsUnitId=${id}`).join(' or ');
const acqUnitsQuery = acqUnits.map(id => `acquisitionsUnitId==${id}`).join(' or ');
const searchParams = {
limit: LIMIT_MAX,
query: `userId=${userId} and (${acqUnitsQuery})`,
query: `userId==${userId} and (${acqUnitsQuery})`,
};

const { data = {}, isFetching } = useQuery(
Expand Down

0 comments on commit 425a3ff

Please sign in to comment.