I need to do a prism query, where my id is the same as the login id, but idk how do I do it, I'm doing it like this, but it filters all titles, and I just need the title of the login that was done now
import React from 'react';
import Link from 'next/link';
import { PrismaClient } from '@prisma/client';
import { signIn, signOut, useSession } from 'next-auth/client';
export async function getStaticProps() {
const prisma = new PrismaClient();
const services = await prisma.service.findUnique({
where: {
id:
},
})
return {
props: {
services,
},
};
}
export default function Home({ services }) {
const [session] = useSession();
return (
<>
{!session && (
<>
Not signed in
{' '}
<br />
<button type="button" onClick={signIn}>Sign In</button>
</>
)}
{session && (
<>
Signed in as {session.user.email} <br />
<ul>
{services.map((service) => (
<li key={service.id}>{service.title}</li>
))}
</ul>
The "service" is my table, and it is linked to the "session" table, both have the id column, and I only need to show the titles of the "service" that are in the id registered in the "session".
does it make sense what I'm saying? Thank you in advance!