Changed route to user set custom day start

This commit is contained in:
Keith Holliday
2016-05-19 21:14:35 +01:00
parent e8b53d6b22
commit 5b7a56d28d
4 changed files with 30 additions and 12 deletions

View File

@@ -1311,22 +1311,22 @@ api.userReset = {
};
/**
* @api {post} /api/v3/user/set-cron Sets lastCron for user
* @api {post} /api/v3/user/set-custom-day-start Sets preferences.dayStart for user
* @apiVersion 3.0.0
* @apiName UserSetCron
* @apiName UserSetCustomDayStart
* @apiGroup User
*
* @apiSuccess {Object} data An empty Object
*/
api.userSetCron = {
api.userSetCustomDayStart = {
method: 'POST',
middlewares: [authWithHeaders()],
url: '/user/set-cron',
url: '/user/set-custom-day-start',
async handler (req, res) {
let user = res.locals.user;
let cron = req.body.lastCron;
let dayStart = req.body.dayStart;
user.lastCron = cron;
user.preferences.dayStart = dayStart;
await user.save();