From a8b985240d2be4d73dad0a0174b57f8b0652f846 Mon Sep 17 00:00:00 2001 From: Zephyrrus Date: Sun, 22 Aug 2021 16:33:28 +0300 Subject: fix: anon upload and domain fix for album links (#292) --- src/api/routes/service/configGET.js | 3 ++- src/api/utils/Util.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/api') diff --git a/src/api/routes/service/configGET.js b/src/api/routes/service/configGET.js index 4baf627..f69d9eb 100644 --- a/src/api/routes/service/configGET.js +++ b/src/api/routes/service/configGET.js @@ -21,7 +21,8 @@ class configGET extends Route { metaThemeColor: Util.config.metaThemeColor, metaDescription: Util.config.metaDescription, metaKeywords: Util.config.metaKeywords, - metaTwitterHandle: Util.metaTwitterHandle + metaTwitterHandle: Util.metaTwitterHandle, + domain: process.env.domain } }); } diff --git a/src/api/utils/Util.js b/src/api/utils/Util.js index 4e91954..b243b2b 100644 --- a/src/api/utils/Util.js +++ b/src/api/utils/Util.js @@ -289,10 +289,10 @@ class Util { const dbFile = await db.table('files') // eslint-disable-next-line func-names .where(function() { - if (user === undefined) { - this.whereNull('userId'); - } else { + if (user) { this.where('userId', user.id); + } else { + this.whereNull('userId'); } }) .where({ -- cgit v1.2.3