Minor fixes for apidocs and comments (#11249)

* improve comments for api.getUserChallenges

* clarify members parameter when creating test guilds

I was uncertain about this parameter and read the code to clarify it.
Reading a comment is easier. :)

* add "Custom Day Start time" to api route's title as it's the common name
This commit is contained in:
Alys 2019-07-10 00:18:41 +10:00 committed by Matteo Pagliazzi
parent 0b32692290
commit 544a703df5
4 changed files with 6 additions and 6 deletions

View file

@ -86,7 +86,7 @@ export async function generateGroup (leader, details = {}, update = {}) {
// This is generate group + the ability to create
// real users to populate it. The settings object
// takes in:
// members: Number - the number of group members to create. Defaults to 0.
// members: Number - the number of group members to create. Defaults to 0. Does not include group leader.
// inivtes: Number - the number of users to create and invite to the group. Defaults to 0.
// groupDetails: Object - how to initialize the group
// leaderDetails: Object - defaults for the leader, defaults with a gem balance so the user

View file

@ -80,7 +80,7 @@ export async function generateGroup (leader, details = {}, update = {}) {
// This is generate group + the ability to create
// real users to populate it. The settings object
// takes in:
// members: Number - the number of group members to create. Defaults to 0.
// members: Number - the number of group members to create. Defaults to 0. Does not include group leader.
// inivtes: Number - the number of users to create and invite to the group. Defaults to 0.
// groupDetails: Object - how to initialize the group
// leaderDetails: Object - defaults for the leader, defaults with a gem balance so the user

View file

@ -425,11 +425,11 @@ api.getUserChallenges = {
/**
* @api {get} /api/v3/challenges/groups/:groupId Get challenges for a group
* @apiDescription Get challenges that the user is a member, public challenges and the ones from the user's groups.
* @apiDescription Get challenges hosted in the specified group.
* @apiName GetGroupChallenges
* @apiGroup Challenge
*
* @apiParam (Path) {UUID} groupId The group _id
* @apiParam (Path) {UUID} groupId The group id ('party' for the user party and 'habitrpg' for tavern are accepted)
*
* @apiSuccess {Array} data An array of challenges sorted with official challenges first, followed by the challenges in order from newest to oldest
*
@ -462,7 +462,7 @@ api.getGroupChallenges = {
const challenges = await Challenge.find({ group: groupId })
.sort('-createdAt')
// .populate('leader', nameFields) // Only populate the leader as the group is implicit
// .populate('leader', nameFields) // Only populate the leader as the group is implicit // see below why we're not using populate
.exec();
let resChals = challenges.map(challenge => challenge.toJSON());

View file

@ -1539,7 +1539,7 @@ api.userReset = {
};
/**
* @api {post} /api/v3/user/custom-day-start Set preferences.dayStart for user
* @api {post} /api/v3/user/custom-day-start Set preferences.dayStart (Custom Day Start time) for user
* @apiName setCustomDayStart
* @apiGroup User
*