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.

change owner by id

Brian Caod32d5e75e9e4
diff --git a/pages/api/websites/[id]/index.js b/pages/api/websites/[id]/index.js
index 539a32889..5a4f9c754 100644
--- a/pages/api/websites/[id]/index.js
+++ b/pages/api/websites/[id]/index.js
@@ -23,6 +23,7 @@ export default async (req, res) => {
if (req.method === 'POST') {
const { name, domain, owner, enableShareUrl, shareId } = req.body;
const { accountUuid } = req.auth;
+
let account;
if (accountUuid) {
@@ -43,7 +44,7 @@ export default async (req, res) => {
name,
domain,
shareId: shareId ? shareId : newShareId,
- userId: account ? account.id : +owner || undefined,
+ userId: +owner,
},
{ websiteUuid },
);