wip(shared): port sleep op

This commit is contained in:
Matteo Pagliazzi
2016-03-15 16:33:44 +01:00
parent f55df39fb7
commit 490c6a9ae1
7 changed files with 50 additions and 6 deletions
+2
View File
@@ -99,9 +99,11 @@ api.count = count;
// TODO As ops and fns are ported, exported them through the api object
import scoreTask from './ops/scoreTask';
import sleep from './ops/sleep';
api.ops = {
scoreTask,
sleep,
};
api.fns = {};
+2 -2
View File
@@ -1,4 +1,4 @@
module.exports = function(user, req, cb) {
module.exports = function sleep (user) {
user.preferences.sleep = !user.preferences.sleep;
return typeof cb === "function" ? cb(null, {}) : void 0;
return user.preferences.sleep;
};