Added new route for setting last cron and updated front end

This commit is contained in:
Keith Holliday
2016-05-18 23:24:32 +01:00
parent 0a14d29ebb
commit e8b53d6b22
4 changed files with 41 additions and 5 deletions

View File

@@ -1310,4 +1310,28 @@ api.userReset = {
},
};
/**
* @api {post} /api/v3/user/set-cron Sets lastCron for user
* @apiVersion 3.0.0
* @apiName UserSetCron
* @apiGroup User
*
* @apiSuccess {Object} data An empty Object
*/
api.userSetCron = {
method: 'POST',
middlewares: [authWithHeaders()],
url: '/user/set-cron',
async handler (req, res) {
let user = res.locals.user;
let cron = req.body.lastCron;
user.lastCron = cron;
await user.save();
res.respond(200, {});
},
};
module.exports = api;