Merge branch 'develop' into release

This commit is contained in:
Sabe Jones
2018-08-16 14:41:09 -05:00
13 changed files with 5910 additions and 7105 deletions

View File

@@ -159,6 +159,7 @@ api.postChat = {
}
if (!group) throw new NotFound(res.t('groupNotFound'));
if (group.privacy !== 'private' && user.flags.chatRevoked) {
throw new NotAuthorized(res.t('chatPrivilegesRevoked'));
}

View File

@@ -273,6 +273,7 @@ api.updateHero = {
if (updateData.auth && updateData.auth.blocked === false) {
hero.auth.blocked = false;
}
if (updateData.flags && _.isBoolean(updateData.flags.chatRevoked)) hero.flags.chatRevoked = updateData.flags.chatRevoked;
let savedHero = await hero.save();

View File

@@ -1445,8 +1445,8 @@ api.userSell = {
* @apiParam (Query) {String} path Full path to unlock. See "content" API call for list of items.
*
* @apiParamExample {curl}
* curl -x POST http://habitica.com/api/v3/user/unlock?path=background.midnight_clouds
* curl -x POST http://habitica.com/api/v3/user/unlock?path=hair.color.midnight
* curl -X POST http://habitica.com/api/v3/user/unlock?path=background.midnight_clouds
* curl -X POST http://habitica.com/api/v3/user/unlock?path=hair.color.midnight
*
* @apiSuccess {Object} data.purchased
* @apiSuccess {Object} data.items

View File

@@ -5,24 +5,24 @@ import { authWithHeaders } from '../../../middlewares/auth';
let api = {};
/**
* @api {post} /api/v3/user/allocate Allocate a single attribute point
* @api {post} /api/v3/user/allocate Allocate a single Stat Point (previously called Attribute Point)
* @apiName UserAllocate
* @apiGroup User
*
* @apiParam (Body) {String="str","con","int","per"} stat Query parameter - Default ='str'
* @apiParam (Query) {String="str","con","int","per"} stat The Stat to increase. Default is 'str'
*
* @apiParamExample {json} Example request
* {"stat":"int"}
* @apiParamExample {curl}
* curl -X POST -d "" https://habitica.com/api/v3/user/allocate?stat=int
*
* @apiSuccess {Object} data Returns stats from the user profile
* @apiSuccess {Object} data Returns stats and notifications from the user profile
*
* @apiError {NotAuthorized} NoPoints Not enough attribute points to increment a stat.
* @apiError {NotAuthorized} NoPoints You don't have enough Stat Points.
*
* @apiErrorExample {json}
* {
* "success": false,
* "error": "NotAuthorized",
* "message": "You don't have enough attribute points."
* "message": "You don't have enough Stat Points."
* }
*/
api.allocate = {
@@ -40,7 +40,7 @@ api.allocate = {
};
/**
* @api {post} /api/v3/user/allocate-bulk Allocate multiple attribute points
* @api {post} /api/v3/user/allocate-bulk Allocate multiple Stat Points
* @apiName UserAllocateBulk
* @apiGroup User
*
@@ -49,22 +49,22 @@ api.allocate = {
* @apiParamExample {json} Example request
* {
* stats: {
* 'int': int,
* 'str': int,
* 'con': int,
* 'per': int,
* },
* "int": int,
* "str": str,
* "con": con,
* "per": per
* }
* }
*
* @apiSuccess {Object} data Returns stats from the user profile
* @apiSuccess {Object} data Returns stats and notifications from the user profile
*
* @apiError {NotAuthorized} NoPoints Not enough attribute points to increment a stat.
* @apiError {NotAuthorized} NoPoints You don't have enough Stat Points.
*
* @apiErrorExample {json}
* {
* "success": false,
* "error": "NotAuthorized",
* "message": "You don't have enough attribute points."
* "message": "You don't have enough Stat Points."
* }
*/
api.allocateBulk = {
@@ -82,7 +82,7 @@ api.allocateBulk = {
};
/**
* @api {post} /api/v3/user/allocate-now Allocate all attribute points
* @api {post} /api/v3/user/allocate-now Allocate all Stat Points
* @apiDescription Uses the user's chosen automatic allocation method, or if none, assigns all to STR. Note: will return success, even if there are 0 points to allocate.
* @apiName UserAllocateNow
* @apiGroup User
@@ -119,7 +119,8 @@ api.allocateBulk = {
* "per": 0,
* "str": 0,
* "con": 0
* }
* },
* "notifications": [ .... ],
* }
* }
*