diff --git a/test/api/v3/integration/groups/POST-groups_invite.test.js b/test/api/v3/integration/groups/POST-groups_invite.test.js index cf53782c8d..92328463b2 100644 --- a/test/api/v3/integration/groups/POST-groups_invite.test.js +++ b/test/api/v3/integration/groups/POST-groups_invite.test.js @@ -316,7 +316,7 @@ describe('Post /groups/:groupId/invite', () => { }); }); - it('allow inviting an user to a party if he\'s partying solo', async () => { + it('allow inviting a user to a party if he\'s partying solo', async () => { let userToInvite = await generateUser(); await userToInvite.post('/groups', { // add user to a party name: 'Another Test Party', diff --git a/test/api/v3/integration/quests/POST-groups_groupid_quests_reject.test.js b/test/api/v3/integration/quests/POST-groups_groupid_quests_reject.test.js index 1eb62aa0c6..2dcddfe727 100644 --- a/test/api/v3/integration/quests/POST-groups_groupid_quests_reject.test.js +++ b/test/api/v3/integration/quests/POST-groups_groupid_quests_reject.test.js @@ -70,7 +70,7 @@ describe('POST /groups/:groupId/quests/reject', () => { }); }); - it('return an error when an user rejects an invite twice', async () => { + it('return an error when a user rejects an invite twice', async () => { await leader.post(`/groups/${questingGroup._id}/quests/invite/${PET_QUEST}`); await partyMembers[0].post(`/groups/${questingGroup._id}/quests/reject`); @@ -82,7 +82,7 @@ describe('POST /groups/:groupId/quests/reject', () => { }); }); - it('return an error when an user rejects an invite already accepted', async () => { + it('return an error when a user rejects an invite already accepted', async () => { await leader.post(`/groups/${questingGroup._id}/quests/invite/${PET_QUEST}`); await partyMembers[0].post(`/groups/${questingGroup._id}/quests/accept`); diff --git a/website/server/controllers/api-v3/auth.js b/website/server/controllers/api-v3/auth.js index 1a5f6f36ae..f501ba8c50 100644 --- a/website/server/controllers/api-v3/auth.js +++ b/website/server/controllers/api-v3/auth.js @@ -168,7 +168,7 @@ function _loginRes (user, req, res) { /** * @api {post} /api/v3/user/auth/local/login Login - * @apiDescription Login an user with email / username and password + * @apiDescription Login a user with email / username and password * @apiVersion 3.0.0 * @apiName UserLoginLocal * @apiGroup User diff --git a/website/server/controllers/api-v3/quests.js b/website/server/controllers/api-v3/quests.js index 0e639def36..3443f9d67d 100644 --- a/website/server/controllers/api-v3/quests.js +++ b/website/server/controllers/api-v3/quests.js @@ -177,7 +177,7 @@ api.acceptQuest = { res.respond(200, savedGroup.quest); - // track that an user has accepted the quest + // track that a user has accepted the quest analytics.track('quest', { category: 'behavior', owner: false, diff --git a/website/server/controllers/api-v3/tags.js b/website/server/controllers/api-v3/tags.js index 8d452154cd..69117e6fd7 100644 --- a/website/server/controllers/api-v3/tags.js +++ b/website/server/controllers/api-v3/tags.js @@ -34,7 +34,7 @@ api.createTag = { }; /** - * @api {get} /api/v3/tag Get an user's tags + * @api {get} /api/v3/tag Get a user's tags * @apiVersion 3.0.0 * @apiName GetTags * @apiGroup Tag diff --git a/website/server/controllers/api-v3/tasks.js b/website/server/controllers/api-v3/tasks.js index a6b2405539..0abe8f051b 100644 --- a/website/server/controllers/api-v3/tasks.js +++ b/website/server/controllers/api-v3/tasks.js @@ -166,7 +166,7 @@ async function _getTasks (req, res, user, challenge) { } /** - * @api {get} /api/v3/tasks/user Get an user's tasks + * @api {get} /api/v3/tasks/user Get a user's tasks * @apiVersion 3.0.0 * @apiName GetUserTasks * @apiGroup Task @@ -259,7 +259,7 @@ api.getTask = { if (!challenge || (user.challenges.indexOf(task.challenge.id) === -1 && challenge.leader !== user._id && !user.contributor.admin)) { // eslint-disable-line no-extra-parens throw new NotFound(res.t('taskNotFound')); } - } else if (task.userId !== user._id) { // If the task is owned by an user make it's the current one + } else if (task.userId !== user._id) { // If the task is owned by a user make it's the current one throw new NotFound(res.t('taskNotFound')); } @@ -300,7 +300,7 @@ api.updateTask = { challenge = await Challenge.findOne({_id: task.challenge.id}).exec(); if (!challenge) throw new NotFound(res.t('challengeNotFound')); if (challenge.leader !== user._id) throw new NotAuthorized(res.t('onlyChalLeaderEditTasks')); - } else if (task.userId !== user._id) { // If the task is owned by an user make it's the current one + } else if (task.userId !== user._id) { // If the task is owned by a user make it's the current one throw new NotFound(res.t('taskNotFound')); } @@ -517,7 +517,7 @@ api.addChecklistItem = { challenge = await Challenge.findOne({_id: task.challenge.id}).exec(); if (!challenge) throw new NotFound(res.t('challengeNotFound')); if (challenge.leader !== user._id) throw new NotAuthorized(res.t('onlyChalLeaderEditTasks')); - } else if (task.userId !== user._id) { // If the task is owned by an user make it's the current one + } else if (task.userId !== user._id) { // If the task is owned by a user make it's the current one throw new NotFound(res.t('taskNotFound')); } @@ -610,7 +610,7 @@ api.updateChecklistItem = { challenge = await Challenge.findOne({_id: task.challenge.id}).exec(); if (!challenge) throw new NotFound(res.t('challengeNotFound')); if (challenge.leader !== user._id) throw new NotAuthorized(res.t('onlyChalLeaderEditTasks')); - } else if (task.userId !== user._id) { // If the task is owned by an user make it's the current one + } else if (task.userId !== user._id) { // If the task is owned by a user make it's the current one throw new NotFound(res.t('taskNotFound')); } if (task.type !== 'daily' && task.type !== 'todo') throw new BadRequest(res.t('checklistOnlyDailyTodo')); @@ -663,7 +663,7 @@ api.removeChecklistItem = { challenge = await Challenge.findOne({_id: task.challenge.id}).exec(); if (!challenge) throw new NotFound(res.t('challengeNotFound')); if (challenge.leader !== user._id) throw new NotAuthorized(res.t('onlyChalLeaderEditTasks')); - } else if (task.userId !== user._id) { // If the task is owned by an user make it's the current one + } else if (task.userId !== user._id) { // If the task is owned by a user make it's the current one throw new NotFound(res.t('taskNotFound')); } if (task.type !== 'daily' && task.type !== 'todo') throw new BadRequest(res.t('checklistOnlyDailyTodo')); @@ -874,7 +874,7 @@ api.deleteTask = { challenge = await Challenge.findOne({_id: task.challenge.id}).exec(); if (!challenge) throw new NotFound(res.t('challengeNotFound')); if (challenge.leader !== user._id) throw new NotAuthorized(res.t('onlyChalLeaderEditTasks')); - } else if (task.userId !== user._id) { // If the task is owned by an user make it's the current one + } else if (task.userId !== user._id) { // If the task is owned by a user make it's the current one throw new NotFound(res.t('taskNotFound')); } else if (task.userId && task.challenge.id && !task.challenge.broken) { throw new NotAuthorized(res.t('cantDeleteChallengeTasks')); diff --git a/website/server/models/user.js b/website/server/models/user.js index f3c22d3709..9cce45fc55 100644 --- a/website/server/models/user.js +++ b/website/server/models/user.js @@ -728,7 +728,7 @@ schema.methods.sendMessage = async function sendMessage (userToReceiveMessage, m // Methods to adapt the new schema to API v2 responses (mostly tasks inside the user model) // These will be removed once API v2 is discontinued -// Get all the tasks belonging to an user, +// Get all the tasks belonging to a user, schema.methods.getTasks = function getUserTasks () { let args = Array.from(arguments); let cb;