feat: api token functions

This commit is contained in:
Catalin Pit
2023-11-24 16:13:09 +02:00
parent 80fe7ccdf5
commit fbee6eedc1
3 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,15 @@
import { prisma } from '@documenso/prisma';
export type DeleteTokenByIdOptions = {
id: number;
userId: number;
};
export const deleteTokenById = async ({ id, userId }: DeleteTokenByIdOptions) => {
return prisma.apiToken.delete({
where: {
id,
userId,
},
});
};