Skip to content

Commit 69e0b32

Browse files
Simon Hosimonhoibm
Simon Ho
authored andcommitted
Define a remote hook
1 parent 8700202 commit 69e0b32

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

common/models/review.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
module.exports = function(Review) {
2-
2+
Review.beforeRemote('create', function(context, user, next) {
3+
context.args.data.date = Date.now();
4+
context.args.data.publisherId = context.req.accessToken.userId;
5+
next();
6+
});
37
};

0 commit comments

Comments
 (0)