Answer the question
In order to leave comments, you need to log in
How to get parameter from get in post node.js?
Good afternoon, the question is probably stupid, but I can’t solve it myself and I don’t have anyone to ask.
The bottom line is, there are two html forms, the first one adds general user information (first name, last name, etc.) and assigns a unique uuid there.
The second form is the page for adding user contacts (phone, insta, telegram, etc.)
uuid is passed to the url and I can get it via get:
router.get('/:uuid', async (req, res) => {
const uuid = req.body.uuid
console.log(uuid)
res.render('add_contacts ')
})
but in post I can't, I get undefined
router.post('/', async (req, res) => {
const { phone, tg, instagram, vk, uuid} = req.body
console.log ( uid)
Displays everything except uuid, it is not defined
Please tell me how to get it and in which direction to dig?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question