Skip to content

Commit

Permalink
Move history=true by default from activeRidQuery() to getRoute()
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieulemieux committed Jun 24, 2024
1 parent 1f483ec commit b94552a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/routes/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ const { checkStandardOptions } = require('../repo/query_builder/util');
const { OPERATORS } = require('../repo/query_builder/constants');

const activeRidQuery = (modelName, rid, opt = {}) => {
const { history, ...rest } = opt;
const query = parse({
...opt,
...rest,
filters: { '@this': modelName, operator: OPERATORS.INSTANCEOF },
history: true,
history: history || false,
target: [rid],
});
return query;
Expand All @@ -46,7 +47,7 @@ const getRoute = (app, model) => {
let query;

try {
query = activeRidQuery(model.name, req.params.rid, { neighbors });
query = activeRidQuery(model.name, req.params.rid, { history: true, neighbors });
} catch (err) {
if (err instanceof ValidationError) {
return next(err);
Expand Down

0 comments on commit b94552a

Please sign in to comment.