Make responce codes uniform (#8865)

* Fix 201 responce wrong documentation

* Fix 201 in challenges

* Fix 201 in groups.js

* Fix 201 in tags.js

* Fix 201 in webhooks.js
This commit is contained in:
Pavel Pletenev
2017-07-18 01:28:25 +04:00
committed by Sabe Jones
parent 5f3539da19
commit 0da1144635
5 changed files with 13 additions and 13 deletions

View File

@@ -158,7 +158,7 @@ let api = {};
* @apiParam (Body) {Boolean} [official=false] Whether or not a challenge is an official Habitica challenge (requires admin)
* @apiParam (Body) {Number} [challenge.prize=0] Number of gems offered as a prize to challenge winner
*
* @apiSuccess {Object} challenge The newly created challenge.
* @apiSuccess (201) {Object} challenge The newly created challenge.
* @apiUse SuccessfulChallengeRequest
*
* @apiUse ChallengeSuccessExample

View File

@@ -83,7 +83,7 @@ let api = {};
* @apiError (400) {NotAuthorized} partyMustbePrivate Party must have privacy set to private
* @apiError (400) {NotAuthorized} messageGroupAlreadyInParty
*
* @apiSuccess {Object} data The created group (See <a href="https://github.com/HabitRPG/habitica/blob/develop/website/server/models/group.js" target="_blank">/website/server/models/group.js</a>)
* @apiSuccess (201) {Object} data The created group (See <a href="https://github.com/HabitRPG/habitica/blob/develop/website/server/models/group.js" target="_blank">/website/server/models/group.js</a>)
*
* @apiSuccessExample {json} Private Guild:
* HTTP/1.1 200 OK
@@ -174,7 +174,7 @@ api.createGroup = {
* @apiName CreateGroupPlan
* @apiGroup Group
*
* @apiSuccess {Object} data The created group
* @apiSuccess (201) {Object} data The created group
*/
api.createGroupPlan = {
method: 'POST',

View File

@@ -30,7 +30,7 @@ let api = {};
* @apiParamExample {json} Example body:
* {"name":"practicetag"}
*
* @apiSuccess {Object} data The newly created tag
* @apiSuccess (201) {Object} data The newly created tag
*
* @apiSuccessExample {json} Example return:
* {"success":true,"data":{"name":"practicetag","id":"8bc0afbf-ab8e-49a4-982d-67a40557ed1a"},"notifications":[]}

View File

@@ -86,7 +86,7 @@ let requiredGroupFields = '_id leader tasksOrder name';
* "priority":2
* }
*
* @apiSuccess data An object if a single task was created, otherwise an array of tasks
* @apiSuccess (201) data An object if a single task was created, otherwise an array of tasks
*
* @apiSuccessExample {json} Success-Response:
* {
@@ -203,7 +203,7 @@ api.createUserTasks = {
* @apiParamExample {json} Request-Example:
* {"type":"todo","text":"Test API Params"}
*
* @apiSuccess data An object if a single task was created, otherwise an array of tasks
* @apiSuccess (201) data An object if a single task was created, otherwise an array of tasks
*
* @apiSuccessExample {json} Example return:
* {"success":true,"data":{"text":"Test API Params","type":"todo","notes":"","tags":[],"value":0,"priority":1,"attribute":"str","challenge":{"id":"f23c12f2-5830-4f15-9c36-e17fd729a812"},"group":{"assignedUsers":[],"approval":{"required":false,"approved":false,"requested":false}},"reminders":[],"_id":"4a29874c-0308-417b-a909-2a7d262b49f6","createdAt":"2017-01-13T21:23:05.949Z","updatedAt":"2017-01-13T21:23:05.949Z","checklist":[],"collapseChecklist":false,"completed":false,"id":"4a29874c-0308-417b-a909-2a7d262b49f6"},"notifications":[]}

View File

@@ -61,13 +61,13 @@ let api = {};
* "url": "http://some-webhook-url.com"
* }
*
* @apiSuccess {Object} data The created webhook
* @apiSuccess {UUID} data.id The uuid of the webhook
* @apiSuccess {String} data.url The url of the webhook
* @apiSuccess {String} data.label A label for you to keep track of what this webhooks is for
* @apiSuccess {Boolean} data.enabled Whether the webhook should be sent
* @apiSuccess {String} data.type The type of the webhook
* @apiSuccess {Object} data.options The options for the webhook (See examples)
* @apiSuccess (201) {Object} data The created webhook
* @apiSuccess (201) {UUID} data.id The uuid of the webhook
* @apiSuccess (201) {String} data.url The url of the webhook
* @apiSuccess (201) {String} data.label A label for you to keep track of what this webhooks is for
* @apiSuccess (201) {Boolean} data.enabled Whether the webhook should be sent
* @apiSuccess (201) {String} data.type The type of the webhook
* @apiSuccess (201) {Object} data.options The options for the webhook (See examples)
*
* @apiUse WebhookBodyInvalid
*/