mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user