Skip to content

Can I modify a QueryBuilder in a Feathers hook? #147

Answered by sokulski
sokulski asked this question in Q&A
Discussion options

You must be logged in to vote

Disregard. It appears I can do this without much fuss:

const { raw } = require('objection');

// eslint-disable-next-line no-unused-vars
module.exports = (options = {}) => {
  return async context => {
    if(context.data[options]) {
      context.data[options] = raw('NOW()');
    }

    return context;
  };
};

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sokulski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant