Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

fix admin/website

Brian Cao36928d4f04b6
diff --git a/src/pages/api/admin/websites.ts b/src/pages/api/admin/websites.ts
index 58a595867..686de6cb4 100644
--- a/src/pages/api/admin/websites.ts
+++ b/src/pages/api/admin/websites.ts
@@ -10,7 +10,7 @@ import * as yup from 'yup';
export interface WebsitesRequestQuery extends PageParams {
userId?: string;
- includeTeams?: boolean;
+ includeOwnedTeams?: boolean;
}
export interface WebsitesRequestBody {
@@ -43,27 +43,28 @@ export default async (
return unauthorized(res);
}
- const { userId, includeTeams } = req.query;
+ const { userId, includeOwnedTeams } = req.query;
const websites = await getWebsites(
{
where: {
OR: [
...(userId && [{ userId }]),
- ...(userId &&
- includeTeams && [
- {
- team: {
- deletedAt: null,
- teamUser: {
- some: {
- role: ROLES.teamOwner,
- userId,
+ ...(userId && includeOwnedTeams
+ ? [
+ {
+ team: {
+ deletedAt: null,
+ teamUser: {
+ some: {
+ role: ROLES.teamOwner,
+ userId,
+ },
},
},
},
- },
- ]),
+ ]
+ : []),
],
},
include: {