hawki
hawki3w ago

hawki - @Gaurav Chadha hey 👋 quick question: d...

@Gaurav Chadha hey 👋 quick question: do you know why this node is writing ‘undefined’ to my Firestore DB despite using the right variable as an argument? Any help would be hugely appreciated
Solution:
Yes, simply add more parameters to the request body and each parameter can be accessed with their key `{ "key1": "value1", "key2": "value2",...
Jump to solution
7 Replies
hawki
hawki3w ago
No description
No description
Gaurav Chadha
Gaurav Chadha3w ago
@hawki In your request body, you'll need to remove the body key object, simply provide this as body: { "pending": "you text" }
hawki
hawki3w ago
Can I set the pending status to be dynamic based on the parameter I pass through the body code? This will change depending on what is sent to this particular API There will be other parameters passed in too, as well as the pending parameter and I’ll need to determine where in the json to use them
Gaurav Chadha
Gaurav Chadha3w ago
yeah, it is already dynamic as you are using a variable (body). it will take the value you sent to it from your client side.
hawki
hawki3w ago
Ok, but is it possible to access the parameter within the body? I intend to send a single body code with multiple parameters in and use the parameters to write to individual fields within a Firestore document. Sorry, probably missing something obvious here!
Solution
Gaurav Chadha
Gaurav Chadha3w ago
Yes, simply add more parameters to the request body and each parameter can be accessed with their key { "key1": "value1", "key2": "value2", }
hawki
hawki3w ago
Ah ok I must’ve been overcomplicating it. I’ll give it a try Yep, I see now. Noob mistake. Thanks for your help @Gaurav Chadha ! 🙏