Ported release both, added unit tests, add release both route with integration tests

This commit is contained in:
Keith Holliday
2016-04-03 14:43:16 -05:00
parent d133fc08f2
commit c916c74775
6 changed files with 224 additions and 40 deletions

View File

@@ -764,4 +764,24 @@ api.userOpenMysteryItem = {
},
};
/**
* @api {post} /user/release-both Releases Pets and Mounts and grants Triad Bingo.
* @apiVersion 3.0.0
* @apiName UserReleaseBoth
* @apiGroup User
*
* @apiSuccess {Object} data `user.items.gear.owned`
*/
api.userReleaseBoth = {
method: 'POST',
middlewares: [authWithHeaders(), cron],
url: '/user/release-both',
async handler (req, res) {
let user = res.locals.user;
let releaseBothResponse = common.ops.releaseBoth(user, req, res.analytics);
await user.save();
res.respond(200, releaseBothResponse);
},
};
module.exports = api;