Skip to content

Commit

Permalink
Retrieve upto 100 results from users endpoint for internal contacts, …
Browse files Browse the repository at this point in the history
…refs ERM-980 (#564)
  • Loading branch information
adi-mat committed Jul 6, 2020
1 parent 25ba10e commit 19b0b71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/routes/AgreementEditRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import View from '../components/views/AgreementForm';
import NoPermissions from '../components/NoPermissions';
import { urls } from '../components/utilities';

const RECORDS_PER_REQUEST = 100;

class AgreementEditRoute extends React.Component {
static manifest = Object.freeze({
agreement: {
Expand All @@ -30,7 +32,7 @@ class AgreementEditRoute extends React.Component {
stats: 'true',
},
limitParam: 'perPage',
perRequest: 100,
perRequest: RECORDS_PER_REQUEST,
records: 'results',
recordsRequired: '1000',
},
Expand Down Expand Up @@ -104,6 +106,7 @@ class AgreementEditRoute extends React.Component {
users: {
type: 'okapi',
path: 'users',
perRequest: RECORDS_PER_REQUEST,
params: (_q, _p, _r, _l, props) => {
const query = (props?.resources?.agreement?.records?.[0]?.contacts ?? [])
.filter(contact => contact.user)
Expand Down
1 change: 1 addition & 0 deletions src/routes/AgreementViewRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class AgreementViewRoute extends React.Component {
users: {
type: 'okapi',
path: 'users',
perRequest: RECORDS_PER_REQUEST,
params: (_q, _p, _r, _l, props) => {
const query = get(props.resources, 'agreement.records[0].contacts', [])
.filter(contact => contact.user)
Expand Down

0 comments on commit 19b0b71

Please sign in to comment.