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,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
};
|