I'm working with data from a PostgreSQL database:
https://i.sstatic.net/3nLrs.png
My goal is to retrieve the id, name, and content in a NextJS component as shown below:
export async function getServerSideProps() {
const data = await prisma.note.findFirst()
return {
props: {
userNote: data,
},
}
}
interface INote {
id: number
name: string
content: string
}
const Home = ({ name, content, id }: INote) => {
console.log(name)
return <div>hello world</div>
}
However, when I try to access these values, they are coming up as undefined. What could be causing this issue?