0

Before I pass my data to my query, the user's data is complete and it has all the data but when it's passed on the receiving url, it's missing some data.

I passed the data like this href={{ pathname: "/update/" + user.id, query: user, }}

And received it like this

const router = useRouter();
const query = router.query;
const data = query;

But when I console.log my user data, it seems to be missing the nested obj data. The result was

{id: '1', user_information: '', contact_information: ''} 

when it's supposed to be

{user_information: {...}, contact_information:{...}
skndstry
  • 678
  • 1
  • 7
  • 21
  • The entries of the object you pass to `query` have to be strings, those values will be passed in the URL's query string. You can't have nested objects. – juliomalves Nov 20 '22 at 16:31

0 Answers0