The Terasology Foundation

Modify user update API to update user info in database

Reference: Github Issue

What you will need to know?

Javascript, Node.js, RESTful APIs, MongoDB

Modify the API to let user update info on Donut Platform

In this task, you are supposed to make an API that will help the user in updating his/her info on the Donut platform. As of now, the API allows the user to update his name, email, password. We need to add more fields that user can update - college/company, website, location, about. For this task, you are supposed to update the API such that the it starts accepting these fields for updation. You will also need to modify the user schema accordingly such that these fields are updated in the database. The update API should have a check that only fields that are available in the database are only updated so that API does not accept any random field for an update.

Expected Outcome

An authenticated user should be able to update info successfully using the API with proper status code and response in return. The updated data should be reflected in the MongoDB database.

Resources & References (Where to Start)

I found these articles to be great to understand about RESTful APIs and working with MongoDB database: https://medium.com/@jeffandersen/building-a-node-js-rest-api-with-express-46b0901f29b6 https://www.toptal.com/nodejs/secure-rest-api-in-nodejs https://alligator.io/nodejs/building-rest-api/

Extras

In case you feel confused or need help you can join our channel - [codeuino slack(http://slack.codeuino.org/).

Task tags

  • mongodb
  • express
  • REST
  • javascript
  • nodejs

Students who completed this task

Torpedo

Task type

  • code Code
close

2019