0

enter image description here I have attached the root cause files here

enter image description here

I want to fetch the userrole of the table users and it ain't working via its session, after the user has loggedIn using his email & password. After the userrole is fetched from the Vercel/postgres db I want to conditional render either a logbook or manifest components. Also tried to use CoPilot & Ollama/8b with no success.

5
  • Have you tried removing parameter from getUser(). Your definition requires an email parameter. Commented May 6, 2024 at 7:17
  • Hi Dave, thanks for your reply. Do you mean on data.ts row 6? I've now tried that but in row 9 I am querying for "email" in the sql db, hence to my understanding "email" must be defined in the function. What am I missing? Commented May 6, 2024 at 17:58
  • Yes, I mean at data.ts line 6, getUser request for an email parameter but in page.tsx you did not provide. And since your email can be accessed by session, try replace parameter with const {email} = session? Commented May 7, 2024 at 5:58
  • Hi Dave, yes! Thanks that worked! Solved! Thanks for the help! Commented May 9, 2024 at 7:53
  • Good to hear that, I will post it as an answer if you're willing to accept it as an answer. Commented May 9, 2024 at 8:53

1 Answer 1

0

Yes, I mean at data.ts line 6, getUser request for an email parameter but in page.tsx you did not provide.

And since your email can be accessed by session, try replace parameter with const {email} = session

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.