Files
sign/packages/lib/server-only/public-api/get-api-token-by-id.ts

16 lines
306 B
TypeScript
Raw Normal View History

2023-11-24 16:13:09 +02:00
import { prisma } from '@documenso/prisma';
export type GetApiTokenByIdOptions = {
id: number;
userId: number;
};
export const getApiTokenById = async ({ id, userId }: GetApiTokenByIdOptions) => {
2024-01-22 17:38:02 +11:00
return await prisma.apiToken.findFirstOrThrow({
2023-11-24 16:13:09 +02:00
where: {
id,
userId,
},
});
};