Created
September 8, 2016 23:02
-
-
Save dearfrankg/3325a395b595d6b729f07080d9173de3 to your computer and use it in GitHub Desktop.
Create a remote hook - common/models/review.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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