Skip to content

Commit 96905af

Browse files
committed
Define a remote hook
1 parent d2ac091 commit 96905af

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,5 +1,9 @@
11
'use strict';
22

33
module.exports = function(Review) {
4-
4+
Review.beforeRemote('create', function(context, user, next) {
5+
context.args.data.date = Date.now();
6+
context.args.data.publisherId = context.req.accessToken.userId;
7+
next();
8+
});
59
};

0 commit comments

Comments
 (0)