umami/queries/admin/website/getUserWebsites.ts

14 lines
269 B
TypeScript
Raw Normal View History

2022-08-28 06:38:35 +02:00
import prisma from 'lib/prisma';
2022-11-15 22:21:14 +01:00
import { Website } from '@prisma/client';
2022-07-12 23:14:36 +02:00
2022-11-15 22:21:14 +01:00
export async function getUserWebsites(userId): Promise<Website[]> {
2022-08-28 06:38:35 +02:00
return prisma.client.website.findMany({
2022-11-02 23:45:47 +01:00
where: {
userId,
},
2022-08-28 06:38:35 +02:00
orderBy: {
name: 'asc',
},
});
2022-07-12 23:14:36 +02:00
}