Skip to content

Commit

Permalink
Merge pull request #250 from flyvictor/PO-4636-bookings-list-screen
Browse files Browse the repository at this point in the history
fix(PO-4636): fix query string include
  • Loading branch information
iliazubkov authored Jul 12, 2024
2 parents 2707c8b + 79fd83a commit 7ba3afb
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions lib/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,7 @@ function route(
const includeMeta =
req.query.includeMeta &&
!_.isBoolean(req.query.includeMeta) &&
_.without(
ensureQueryArray(req.query.includeMeta).split(','),
'count',
'true',
);
_.without(ensureQueryArray(req.query.includeMeta), 'count', 'true');
if (!includeMeta || !includeMeta.length) return object;
object.meta = object.meta || {};
return RSVP.all(
Expand Down Expand Up @@ -659,7 +655,7 @@ function route(
resource: collection,
});

if (req.query.ids) match.id = { $in: req.query.ids.split(',') };
if (req.query.ids) match.id = { $in: ensureQueryArray(req.query.ids) };

//run beforeRead
localTracer('before-read-hooks', () => beforeReadHook({}, req, res))
Expand Down Expand Up @@ -724,12 +720,10 @@ function route(
if (
req.query.includeMeta &&
(_.isBoolean(req.query.includeMeta) ||
ensureQueryArray(req.query.includeMeta)
.split(',')
.indexOf('count') !== -1 ||
ensureQueryArray(req.query.includeMeta)
.split(',')
.indexOf('true') !== -1)
ensureQueryArray(req.query.includeMeta).indexOf('count') !==
-1 ||
ensureQueryArray(req.query.includeMeta).indexOf('true') !==
-1)
) {
//Count all resources that service would potentially allow to read
if (process.env.DISASTER_RECOVERY_COUNT_ENABLED) {
Expand Down

0 comments on commit 7ba3afb

Please sign in to comment.