update getAllwebsites, match usage query with api / cloud call

This commit is contained in:
Francis Cao 2024-05-14 09:39:04 -07:00
parent 0d51f5bb7c
commit c80be88d14
2 changed files with 14 additions and 3 deletions

View File

@ -7,8 +7,7 @@ import * as yup from 'yup';
export interface UserUsageRequestQuery {
id: string;
startAt: string;
endAt: string;
params: { startAt: string; endAt: string };
}
export interface UserUsageRequestResponse {

View File

@ -48,7 +48,19 @@ export async function getWebsites(
export async function getAllWebsites(userId: string) {
return prisma.client.website.findMany({
where: {
userId,
OR: [
{ userId },
{
team: {
deletedAt: null,
teamUser: {
some: {
userId,
},
},
},
},
],
},
});
}