Skip to content

Commit

Permalink
ofmcc-5817 - add pageSize to increase the max number of records in re…
Browse files Browse the repository at this point in the history
…sponse
  • Loading branch information
vietle-cgi committed Sep 13, 2024
1 parent f5131d5 commit ffc2cdd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/src/components/fundingAgreements.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function getFundingAgreements(req, res) {
operation += '&$expand=ofm_application($select=_ofm_expense_authority_value;$expand=ofm_expense_authority($select=ofm_first_name,ofm_last_name))'
}
const filter = `${buildDateFilterQuery(req?.query, 'ofm_start_date')}${buildFilterQuery(req?.query, FundingAgreementMappings)}`
operation += `&$filter=(${filter})&$orderby=ofm_version_number desc`
operation += `&$filter=(${filter})&pageSize=500&$orderby=ofm_version_number desc`
const response = await getOperation(operation)
response?.value?.forEach((funding) => {
const fa = new MappableObjectForFront(funding, FundingAgreementMappings).toJSON()
Expand Down
2 changes: 1 addition & 1 deletion backend/src/components/payments.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function getPayments(req, res) {
const payments = []
let operation = 'ofm_payments?$select=ofm_paymentid,ofm_name,_ofm_facility_value,_ofm_funding_value,ofm_payment_type,ofm_amount,ofm_invoice_date,statuscode,statecode'
const filter = `${buildDateFilterQuery(req?.query, 'ofm_invoice_date')}${buildFilterQuery(req?.query, PaymentMappings)}`
operation += `&$filter=(${filter})`
operation += `&$filter=(${filter})&pageSize=500`
const response = await getOperation(operation)
response?.value?.forEach((item) => payments.push(new MappableObjectForFront(item, PaymentMappings).toJSON()))
return res.status(HttpStatus.OK).json(payments)
Expand Down
2 changes: 1 addition & 1 deletion backend/src/components/reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async function getSurveyResponses(req, res) {
if (req.query?.isSubmitted != null) {
filter += req.query?.isSubmitted === 'true' ? ' and _ofm_contact_value ne null' : ' and _ofm_contact_value eq null'
}
const operation = `ofm_survey_responses?$filter=(${filter})`
const operation = `ofm_survey_responses?$filter=(${filter})&pageSize=500`
const response = await getOperation(operation)
response?.value?.forEach((surveyResponse) => surveyResponses.push(new MappableObjectForFront(surveyResponse, SurveyResponseMappings).toJSON()))
if (isEmpty(surveyResponses)) {
Expand Down

0 comments on commit ffc2cdd

Please sign in to comment.