VRMS icon indicating copy to clipboard operation
VRMS copied to clipboard

Implement a controller for handling UserProfile API endpoints

Open alex-anakin opened this issue 4 years ago • 2 comments

The task is blocked by:

  • [x] #407
  • [x] #431

Overview

Implement a controller for handling UserProfile API endpoints.

Action Items

  • [ ] Add userProfile.controller.js into backend/controllers folder.
  • [ ] Implement POST /userProfiles API endpoint that returns the created userProfile value in the response. Call createUser function of userProfile.service.js.
  • [ ] Implement PATCH /userProfiles API endpoint that returns the updated userProfile value in the response. Don't use parameters. The request body should contain an email. Call updateUser function of userProfile.service.js.
  • [ ] Implement GET /userProfiles/{id} API endpoint that returns userProfile value in the response. Call getUser function of userProfile.service.js.
  • [ ] For all endpoints wrap the call to service function into try/catch. In case of an error get the error message and return it with relevant HTTP code (400 for validation error, 503 for database error). To avoid code duplication implement a reusable function for handling errors.
  • [ ] Cover implemented functionality with tests.

Resources

The project convention about responses' HTTP codes #357

alex-anakin avatar Nov 16 '20 06:11 alex-anakin

Hi @glenflorendo,

If you can, it would be great to have you join us for tomorrow's VRMS tech meeting. That will give us a chance to review this ticket to see if it is the best thing for you to work on.

Thanks!

jasonwong26 avatar Aug 19 '21 09:08 jasonwong26

Hi @glenflorendo,

If you can, it would be great to have you join us for tomorrow's VRMS tech meeting. That will give us a chance to review this ticket to see if it is the best thing for you to work on.

Thanks!

Hey @jasonwong26 . I'm so sorry! I just saw your comment right now. I was helping my family with a move, so I haven't been monitoring my emails. But, the move should be done by next Monday. Could we catch up at another time soon after? Otherwise, I'll attend the meeting next Thursday. 😄

glenflorendo avatar Aug 20 '21 07:08 glenflorendo