mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
update getAllwebsites, match usage query with api / cloud call
This commit is contained in:
parent
8fc755df99
commit
e701d6976b
2 changed files with 14 additions and 3 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue