MakeSchool-Tutorials / Makestagram-Swift-V3

14 stars 7 forks source link

Delete User images from database/storage #92

Closed Thompson632 closed 6 years ago

Thompson632 commented 6 years ago

Just wondering if you could explain or create a tutorial on how to go about deleting the current user's images from the database and the storage. I implemented the options button to be flag (for the user's following) and delete (for the current user's posts). So basically I am trying to figure out how to call a PostService.DeleteCatch(post) type function very similar to the PostService.flag(post).

ocwang commented 6 years ago

On delete, you would grab a reference to your post from the database and do the following:

  1. Use the post id to find and delete the image in Firebase Storage. You can delete images from Storage by following the docs here.
  2. Delete the post by removing it from the database.