mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-28 09:56:25 -05:00
fix(prisma): use findFirst instead of findMany for findOne (#6429)
This commit is contained in:
committed by
Bereket Engida
parent
5fb835ab28
commit
e8a5559cd8
@@ -272,13 +272,10 @@ export const prismaAdapter = (prisma: PrismaClient, config: PrismaConfig) => {
|
||||
|
||||
const selects = convertSelect(select, model, join);
|
||||
|
||||
let result = (
|
||||
await db[model]!.findMany({
|
||||
where: whereClause,
|
||||
select: selects,
|
||||
take: 1,
|
||||
})
|
||||
)[0];
|
||||
let result = await db[model]!.findFirst({
|
||||
where: whereClause,
|
||||
select: selects,
|
||||
});
|
||||
|
||||
// transform the resulting `include` items to use better-auth expected field names
|
||||
if (join && result) {
|
||||
|
||||
Reference in New Issue
Block a user