ZionniteOriginal post
Rank 2: Process
i want to access some data when a user create a document and also when a user delete a document
when I log out this output log({"eventTriggered": JSON.stringify(req.body)}); i get the following
Plain text
so now when i try to access the individual object let says postType it log out empty as though nothing is inside,
so i decided to use JSON.parse(req.body) i got the following errors
Plain text
at JSON.parse (<anonymous>) at Module.default (file:///usr/local/server/src/function/src/main.js:24:28) at execute (/usr/local/server/src/server.js:141:48) at async /usr/local/server/src/server.js:158:13```
Please, what i'm i doing wrong??Summary
Data access issue in response payload when triggering a function.
Developer swapped `JSON.stringify(req.body)` for `JSON.parse(req.bodyRaw)` to fix the problem of accessing data.