mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
19 lines
399 B
TypeScript
19 lines
399 B
TypeScript
import { prisma } from '@documenso/prisma';
|
|
|
|
export type GetMostRecentVerificationTokenByUserIdOptions = {
|
|
userId: number;
|
|
};
|
|
|
|
export const getMostRecentVerificationTokenByUserId = async ({
|
|
userId,
|
|
}: GetMostRecentVerificationTokenByUserIdOptions) => {
|
|
return await prisma.verificationToken.findFirst({
|
|
where: {
|
|
userId,
|
|
},
|
|
orderBy: {
|
|
createdAt: 'desc',
|
|
},
|
|
});
|
|
};
|