Skip to content

Instantly share code, notes, and snippets.

@dearfrankg
Created September 8, 2016 23:02
Show Gist options
  • Select an option

  • Save dearfrankg/3325a395b595d6b729f07080d9173de3 to your computer and use it in GitHub Desktop.

Select an option

Save dearfrankg/3325a395b595d6b729f07080d9173de3 to your computer and use it in GitHub Desktop.
Create a remote hook - common/models/review.js
module.exports = function(Review) {
  Review.beforeRemote('create', function(context, user, next) {
    context.args.data.date = Date.now();
    context.args.data.publisherId = context.req.accessToken.userId;
    next();
  });
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment