hack4impact-uiuc / 7000-languages

Helping Indigenous communities around the world teach, learn and sustain their languages
GNU General Public License v3.0
12 stars 2 forks source link

Connect Course Settings Page to the API #266

Closed ashayp22 closed 1 year ago

ashayp22 commented 2 years ago

Goals

Screen Shot 2022-11-05 at 3 27 53 PM

Let's connect this page to the API! The API endpoint to use to update PATCH /language/course.

Steps for Changing Privacy of Course:

  1. Add a is_private and code field to the CourseDetails MongoDB model in api/src/models/language.js. Default values:is_private is True and code is a random 5 digit alphanumeric string.
  2. Update all API unit tests that will get affected by this field update.
  3. Use the CourseDetails saved in Redux to set the default private/public dropdown and the passcode on the Course Settings page. You'll have to add the default values of is_private and code to the initialState in client/src/redux/slices/language.slice.js.
  4. For updating the field, call PATCH /language/course from the frontend, and only pass in the is_private and code field.

Steps for Deleting a Course

  1. Create an endpoint called DELETE /language/course. Make sure to delete all course data associated with it, from text in MongoDB to files in AWS.

Edge Cases: