mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
25 lines
453 B
TypeScript
25 lines
453 B
TypeScript
import { prisma } from '@documenso/prisma';
|
|
|
|
export type GetUserTokensOptions = {
|
|
userId: string;
|
|
};
|
|
|
|
export const getUserTokens = async ({ userId }: GetUserTokensOptions) => {
|
|
return await prisma.apiToken.findMany({
|
|
where: {
|
|
userId,
|
|
teamId: null,
|
|
},
|
|
select: {
|
|
id: true,
|
|
name: true,
|
|
algorithm: true,
|
|
createdAt: true,
|
|
expires: true,
|
|
},
|
|
orderBy: {
|
|
createdAt: 'desc',
|
|
},
|
|
});
|
|
};
|