diff options
author | 2022-05-15 01:44:18 -0500 | |
---|---|---|
committer | 2022-05-15 19:05:55 -0500 | |
commit | 082b64b6c40fcab3ecf303f53ce83e7753894a32 (patch) | |
tree | 92626869949cc671effce89cfbcd52092243de5c /src/internal-server/start/migrate.js | |
parent | fix: revert "Typescript conversion" (#153) (diff) | |
download | ferdium-app-082b64b6c40fcab3ecf303f53ce83e7753894a32.tar.gz ferdium-app-082b64b6c40fcab3ecf303f53ce83e7753894a32.tar.zst ferdium-app-082b64b6c40fcab3ecf303f53ce83e7753894a32.zip |
Extract utility functions for JSON parsing
Diffstat (limited to 'src/internal-server/start/migrate.js')
-rw-r--r-- | src/internal-server/start/migrate.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/internal-server/start/migrate.js b/src/internal-server/start/migrate.js index 403f7cb86..0af33a977 100644 --- a/src/internal-server/start/migrate.js +++ b/src/internal-server/start/migrate.js | |||
@@ -1,3 +1,4 @@ | |||
1 | const { convertToJSON } = require('../../jsUtils'); | ||
1 | const { ferdiumVersion } = require('../../environment-remote'); | 2 | const { ferdiumVersion } = require('../../environment-remote'); |
2 | 3 | ||
3 | /** | 4 | /** |
@@ -26,10 +27,7 @@ module.exports = async () => { | |||
26 | // Create new user | 27 | // Create new user |
27 | await Database.raw('INSERT INTO "users" ("id") VALUES (\'1\');'); | 28 | await Database.raw('INSERT INTO "users" ("id") VALUES (\'1\');'); |
28 | } else { | 29 | } else { |
29 | settings = | 30 | settings = convertToJSON(user.settings); |
30 | typeof user.settings === 'string' | ||
31 | ? JSON.parse(user.settings) | ||
32 | : user.settings; | ||
33 | } | 31 | } |
34 | 32 | ||
35 | if ( | 33 | if ( |