fix(quests): level up if appropriate after completion

This commit is contained in:
Sabe Jones
2023-10-17 22:29:02 +00:00
parent 06f522e2c9
commit ce1d1a763b
4 changed files with 29 additions and 0 deletions

View File

@@ -1775,4 +1775,26 @@ api.movePinnedItem = {
},
};
/**
* @api {post} /api/v3/user/stat-sync
* Request a refresh of user stats, including processing of pending level-ups
* @apiName StatSync
* @apiGroup User
*
* @apiSuccess {Object} data The user object
*/
api.statSync = {
method: 'POST',
middlewares: [authWithHeaders()],
url: '/user/stat-sync',
async handler (req, res) {
const { user } = res.locals;
common.fns.updateStats(user, user.stats);
await user.save();
res.respond(200, user);
},
};
export default api;