You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my component I created AnswerComp and defined questionId. On clickSubmit i want to get answer, token and questionId. I get the first two but questionId comes undefined
I feel I have to pass dynamic route in my route.post. Kind of how we present "/:slug". I am confused here on one point that whether if I am answering on a particular question with a specific _id, it should print my answer and questionId both. But how to pass my data from url params?
coz currently it prints only answer. questionId comes undefined. And that's what I want to print.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am defining _id: questionId in my backend and I want to fetch my questionId dynamically in my frontend
my route: router.post("/community/postAnswer", postAnswer)
my controller method in node
fetch method in frontend
In my component I created AnswerComp and defined questionId. On clickSubmit i want to get answer, token and questionId. I get the first two but questionId comes undefined
And i created a page of my AnswerComp component
And here's the error I get POST http://192.168.0.102:8000/api/community/postAnswer 400 (Bad Request)
I feel I have to pass dynamic route in my route.post. Kind of how we present "/:slug". I am confused here on one point that whether if I am answering on a particular question with a specific _id, it should print my answer and questionId both. But how to pass my data from url params?
coz currently it prints only answer. questionId comes undefined. And that's what I want to print.
Beta Was this translation helpful? Give feedback.
All reactions