Skip to content

Commit 017b42c

Browse files
committed
Adding logging
1 parent a510241 commit 017b42c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/common/helper.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ async function getMemberIdByHandle (handle) {
169169
return profile.userId
170170
} catch (e) {
171171
// fall back to v3 api...
172+
logger.warn(`Get MemberID by Handle from Dynamo Failed, trying v3 Members API. Error: ${JSON.stringify(e)}`)
172173
return getMemberIdByHandleFromV3Members(handle)
173174
}
174175
}

src/services/ResourceService.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,11 @@ deleteResource.schema = {
344344
* @returns {Array} an array of challenge ids represents challenges that given member has access to.
345345
*/
346346
async function listChallengesByMember (memberId, criteria) {
347-
const res = await helper.getRequest(`${config.USER_API_URL}?filter=id=${memberId}`)
348-
if (_.get(res, 'body.result.content').length === 0) {
349-
throw new errors.BadRequestError(`User with id: ${memberId} doesn't exist`)
350-
}
347+
// removing this call. If a member doesn't exist, it won't find any challenges
348+
// const res = await helper.getRequest(`${config.USER_API_URL}?filter=id=${memberId}`)
349+
// if (_.get(res, 'body.result.content').length === 0) {
350+
// throw new errors.BadRequestError(`User with id: ${memberId} doesn't exist`)
351+
// }
351352

352353
const boolQuery = []
353354
const mustQuery = []

0 commit comments

Comments
 (0)