0
votes

I've successfully used Parse's beforeSave cloud function to modify the data on a User before saving him, but I can't seem to figure out how to get that modified data back to the client. Stuffing relevant modified data into the beforeSave's response.success doesn't seem to work. I'd really like to avoid having the client make an immediate user fetch when the save finishes, or wrapping the user save in a defined Cloud Function that returns the modified data in the response. Thoughts?

1
Do you have an afterSave cloud function?I think you could pass it through the afterSave response. - Dehli
I've tried making an afterSave function, but that doesn't support having a response. FYI: Reponse by Héctor Ramos about afterSave and response parse.com/questions/… - Dave
Oops, I had forgotten. How did you call response.success()? Would you mind showing your code. - Dehli

1 Answers

0
votes

Why don't you write another cloud function (not class afterSave or beforeSave) to make the process and return back the result to the caller. In this scenario, the caller is your device( I assume your client is mobile device), and caller trigger the cloud function with given parameters and cloud function performs the process and returns back whatever you want. So you can use the modified data without any additional fetch.

Hope this helps, Regards