diff --git a/pages/api/websites/[id]/index.js b/pages/api/websites/[id]/index.js index 539a3288..a3771427 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 || account.id, }, { websiteUuid }, );