fetch http request err 500

Have you tried returning the toUpdate variable after updating the relevant collection? (line 30). Moreover, I recommend using Postman chrome extension to check the get and post requests.