Closed
Description
If we have the same user added as a candidate multiple times, then this endpoint returns incorrect data:
-
It returns the same Canidate records multiple times:
-
But it should return different Candidate records, and only userId and jobId would be the same.
Example request with incorrect data: https://api.topcoder-dev.com/v5/taas-teams/16718/jobs/13c44f0c-9d5f-440d-8e3c-626c766ee122
Note, that if we use another endpoint to get candidate, we get correct data: https://api.topcoder-dev.com/v5/jobCandidates?jobId=13c44f0c-9d5f-440d-8e3c-626c766ee122
- This is caused by the incorrect logic here https://github.com/topcoder-platform/taas-apis/blob/dev/src/services/TeamService.js#L271-L297
- While fixing it, we have to make sure, that we don't request user details several times for the same user https://github.com/topcoder-platform/taas-apis/blob/dev/src/services/TeamService.js#L273