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.

Remove user/team transfer from website update.

Brian Cao3efd2a5b1058
diff --git a/pages/api/websites/[id]/index.ts b/pages/api/websites/[id]/index.ts
index 7b634e13c..e525f2378 100644
--- a/pages/api/websites/[id]/index.ts
+++ b/pages/api/websites/[id]/index.ts
@@ -15,8 +15,6 @@ export interface WebsiteRequestBody {
name: string;
domain: string;
shareId: string;
- userId?: string;
- teamId?: string;
}
export default async (
@@ -39,14 +37,10 @@ export default async (
}
if (req.method === 'POST') {
- const { ...data } = req.body;
-
- if (data.userId && data.userId === null && data.teamId && data.teamId === null) {
- badRequest(res, 'A website must be assigned to a User or Team.');
- }
+ const { name, domain, shareId } = req.body;
try {
- await updateWebsite(websiteId, data);
+ await updateWebsite(websiteId, { name, domain, shareId });
} catch (e: any) {
if (e.message.includes('Unique constraint') && e.message.includes('share_id')) {
return serverError(res, 'That share ID is already taken.');