Skip to content

Create member endpoint should return member details #628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
maxceem opened this issue Feb 15, 2021 · 1 comment
Open

Create member endpoint should return member details #628

maxceem opened this issue Feb 15, 2021 · 1 comment

Comments

@maxceem
Copy link
Contributor

maxceem commented Feb 15, 2021

Endpoints GET /v5/projects/:projectId/members, GET /v5/projects/:projectId/members/:id, PATCH /v5/projects/:projectId/members/:id can return additional member details like 'photoURL', 'workingHourStart', 'workingHourEnd', 'timeZone', 'handle', 'email', 'firstName', 'lastName' if we explicitly list them in the fields query param. For example: https://api.topcoder-dev.com/v5/projects/17076/members/?fields=id%2CuserId%2Crole%2CisPrimary%2CdeletedAt%2CcreatedAt%2CupdatedAt%2CdeletedBy%2CcreatedBy%2CupdatedBy%2Chandle%2CphotoURL%2CworkingHourStart%2CworkingHourEnd%2CtimeZone%2Cemail

But the endpoint for creating new members POST /v5/projects/:projectId/members doesn't support returninig these additional fields. So if we want to get these additional details client-side, we would have to make 2 requests: create members and get member details.

We would like to update POST /v5/projects/:projectId/members to also support returning additional member details if they are explicitly listed in the fields query param.

Notes:

  • we already have a reusable method to implement this util.getObjectsWithMemberDetails and we only have to properly apply it here
  • if this method fails to get additional data, we still have to return a response without additional data
  • this method returns 'email', 'firstName', 'lastName' only to admins, which should work the same for this endpoint (nothing to do here as it works automatically, just FYI)

Task:

  • Update method to return members' details.
  • Update Postman if needed.
  • Verify that it works properly.
xxcxy added a commit to xxcxy/tc-project-service that referenced this issue Feb 15, 2021
maxceem added a commit that referenced this issue Feb 16, 2021
…creating

Create member endpoint should return member details #628
@maxceem
Copy link
Contributor Author

maxceem commented Feb 16, 2021

This is done by #629 and merged to DEV.

FYI @RishiRajSahu. We would need this for TaaS API topcoder-platform/taas-apis#148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant