From ecde2da2afa15b374cbf6b0f4f5cc52ec4835455 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Thu, 15 Aug 2024 14:52:38 +0200 Subject: [PATCH] fixes --- packages/api/src/controllers/config.js | 5 +++-- packages/api/src/utility/checkLicense.js | 12 ++---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/packages/api/src/controllers/config.js b/packages/api/src/controllers/config.js index a9af64b25..d8f98bdab 100644 --- a/packages/api/src/controllers/config.js +++ b/packages/api/src/controllers/config.js @@ -13,7 +13,7 @@ const platformInfo = require('../utility/platformInfo'); const connections = require('../controllers/connections'); const { getAuthProviderFromReq } = require('../auth/authProvider'); const { checkLicense, checkLicenseKey } = require('../utility/checkLicense'); -const { storageWriteConfig } = require('./storageDb'); +const storage = require('./storage'); const lock = new AsyncLock(); @@ -146,7 +146,8 @@ module.exports = { async saveLicenseKey({ licenseKey }) { try { if (process.env.STORAGE_DATABASE) { - await storageWriteConfig('license', { licenseKey }); + await storage.writeConfig({ group: 'license', config: { licenseKey } }); + // await storageWriteConfig('license', { licenseKey }); } else { await fs.writeFile(path.join(datadir(), 'license.key'), licenseKey); } diff --git a/packages/api/src/utility/checkLicense.js b/packages/api/src/utility/checkLicense.js index f3534477a..b43b3c1f7 100644 --- a/packages/api/src/utility/checkLicense.js +++ b/packages/api/src/utility/checkLicense.js @@ -1,11 +1,4 @@ -function checkLicenseWeb() { - return { - status: 'ok', - type: 'community', - }; -} - -function checkLicenseApp() { +function checkLicense() { return { status: 'ok', type: 'community', @@ -13,6 +6,5 @@ function checkLicenseApp() { } module.exports = { - checkLicenseWeb, - checkLicenseApp, + checkLicense, };