mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 17:15:37 +01:00
update getAllwebsites, match usage query with api / cloud call
This commit is contained in:
parent
0d51f5bb7c
commit
c80be88d14
2 changed files with 14 additions and 3 deletions
|
|
@ -7,8 +7,7 @@ import * as yup from 'yup';
|
||||||
|
|
||||||
export interface UserUsageRequestQuery {
|
export interface UserUsageRequestQuery {
|
||||||
id: string;
|
id: string;
|
||||||
startAt: string;
|
params: { startAt: string; endAt: string };
|
||||||
endAt: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UserUsageRequestResponse {
|
export interface UserUsageRequestResponse {
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,19 @@ export async function getWebsites(
|
||||||
export async function getAllWebsites(userId: string) {
|
export async function getAllWebsites(userId: string) {
|
||||||
return prisma.client.website.findMany({
|
return prisma.client.website.findMany({
|
||||||
where: {
|
where: {
|
||||||
userId,
|
OR: [
|
||||||
|
{ userId },
|
||||||
|
{
|
||||||
|
team: {
|
||||||
|
deletedAt: null,
|
||||||
|
teamUser: {
|
||||||
|
some: {
|
||||||
|
userId,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue