adrianhajdin / social_media_app

Build a modern social app with a stunning UI with a native mobile feel, a special tech stack, an infinite scroll feature, and amazing performance using React JS, Appwrite, TypeScript, and more.
https://jsmastery.pro
1.21k stars 365 forks source link

Unable to implement delete post feature. #40

Open abhijitpati11 opened 7 months ago

abhijitpati11 commented 7 months ago

While implementing the delete post function i am unable to delete it. Below given is the snapshots of the code, the main handler is in the 'postDetail-ss' mutation function is in 'queryAndMutations-ss' and api is in 'API-ss' while debugging i found that the api-function is not being executed. Kindly help with this problem, any help and guidance will be appreciated. postDetail-ss

queryAndMutations-ss

API-ss

abhijitpati11 commented 7 months ago

anyone help plzzzzzzz

Matx99 commented 6 months ago

@abhijitpati11 Not sure if you got the same problem as me but when I was trying to delete post, if they were saved, then it wouldn't delete. While if they weren't saved, it would be deleted. So, what you've to do is, go to appwrite -> databases -> select your database -> Posts -> "Attributes" tab -> select the 3 dots on the right side of the "save" attribute -> click Edit and then scroll to "On deleting a document" and finally select "Cascade - delete all related documents" and click "Update". You should be able to delete posts now.