software-students-fall2021 / project-setup-penguin

project-setup-penguin created by GitHub Classroom
3 stars 4 forks source link

modify DELETE endpoint for /deck/:deckId URI to delete cardId within users #166

Closed cindykimxp closed 2 years ago

cindykimxp commented 2 years ago

current delete endpoint does not actually delete the cardIds from the cards array within documents in the Users collection...

eventually, we want to be able to do this within DELETE DECK:

  1. Find document by deckID
  2. Delete deck by deckID and get all the cardIds from cards array
  3. Delete all card objects by cardIds
  4. Modify the "cards" array in each user document if it includes one of the cardIds from deck deleted to NOT include deleted cardId