From d32d5e75e9e4b7e11891bd477aeaef61d1833dab Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Sat, 29 Oct 2022 15:50:29 -0700 Subject: [PATCH 1/2] change owner by id --- pages/api/websites/[id]/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/api/websites/[id]/index.js b/pages/api/websites/[id]/index.js index 539a3288..5a4f9c75 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 }, ); From 572df48667135807863d24706fcd05790527c578 Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Mon, 31 Oct 2022 10:38:37 -0700 Subject: [PATCH 2/2] assign backup --- pages/api/websites/[id]/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/api/websites/[id]/index.js b/pages/api/websites/[id]/index.js index 5a4f9c75..a3771427 100644 --- a/pages/api/websites/[id]/index.js +++ b/pages/api/websites/[id]/index.js @@ -44,7 +44,7 @@ export default async (req, res) => { name, domain, shareId: shareId ? shareId : newShareId, - userId: +owner, + userId: +owner || account.id, }, { websiteUuid }, );