Logan
08/10/2022, 12:54 PMconsole.log(session.id);
const userToken = await prisma.account.findFirst({
where: { id: session?.id },
});
console.log(userToken);
Hey all. Just found an issue with my prisma query. When trying to findFirst by id with a value that is undefined it returns the first document in the database. Surely it should only return something if the value id was found?
In the code above, session.id is undefined. the console.log(userToken) returns the first account in the database.Nurul
08/10/2022, 1:12 PMconst userToken = await prisma.account.findFirst({
where: { },
});
which would just return the first record.Logan
08/10/2022, 1:18 PM