Collection Hooks collection('user') forOne returning no data or error
started a topic
almost 4 years ago
Have had several of these Hooks set up before to send out push notifications or emails. With this new account for a new client. My problem is the logger works for calls before the forOne call but nothing is returned error or data with the forOne call. Code below:
Hi, the problem is likely is that you are calling response.continue() before waiting for the findOne function to complete. The findOne function is asynchronous, and will call the callback function you pass to it when it is finished. However, your call to response.continue() happens outside of this callback. The reason your messages aren't being logged is that once response.continue() is called, your endpoint cannot do any more processing.