-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloud Code: afterDelete trigger - cascade deletion of multiple objects not working. #3396
Comments
Can you post the logs of such operation when running with VERBOSE=1? |
@flovilmart Not sure if this is what you mean, but I've added the following to my ParseServer configuration in
Also, from my research, Parse Dashboard already provides the logs. Here are the logs I copied from the Parse Dashboard after deleting a post which had likes and comments associated with that post.
I personally can't tell much from these logs. So I'm not sure if there's a server-side issue or a problem with my Cloud Code syntax for achieving the expected results. |
@flovilmart Any ideas what the issue is here? |
I think the problem is that the Try replacing |
I believe @dstarke has the answer. Also, note that this is not an issue with parse-server but with your core. For such questions, please use Stackoverflow instead. |
Issue Description
Problem:
Using Parse Cloud Code's afterDelete trigger to cascade-delete multiple objects from different Parse classes. For example, after a user deletes a post, I want to also delete comments AND likes associated with that post.
Note: In Parse, I have a Post, Comment, and Like class.
I think the issue(s) with my code is related to either or both of the following:
{useMasterKey: true}
in the appropriate placescomments
results to the associatedlikes
results in the followingthen
promise block so to delete them together viadestroyAll()
I've searched the existing Parse-server Github issues and tried StackOverflow, forums, but haven't found anything to help resolve this.
Steps to reproduce
Here's the code I've written (not working):
Expected Results
After a user deletes a post, it should also delete the comments AND likes associated with that post.
Actual Outcome
None of the comments or likes associated with the post were deleted.
Environment Setup
I appreciate any help. Thank you!
The text was updated successfully, but these errors were encountered: