chore: refactor code

This commit is contained in:
Lucas Smith
2024-02-13 06:01:25 +00:00
parent 4878cf388f
commit d052f02013
4 changed files with 46 additions and 41 deletions

View File

@ -0,0 +1,18 @@
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',
},
});
};