diff options
author | vantezzen <hello@vantezzen.io> | 2019-10-17 21:45:24 +0200 |
---|---|---|
committer | vantezzen <hello@vantezzen.io> | 2019-10-17 21:45:24 +0200 |
commit | ad97ba68b004b746d1e78cedc87a2dab9b93d3c5 (patch) | |
tree | d6a57868a1bb4aa23c13fac0f2d47d7fc8d9c250 /app/Controllers/Http/ServiceController.js | |
parent | Add announcements (diff) | |
download | ferdium-server-ad97ba68b004b746d1e78cedc87a2dab9b93d3c5.tar.gz ferdium-server-ad97ba68b004b746d1e78cedc87a2dab9b93d3c5.tar.zst ferdium-server-ad97ba68b004b746d1e78cedc87a2dab9b93d3c5.zip |
Fix compatability to Postgresql databases
Diffstat (limited to 'app/Controllers/Http/ServiceController.js')
-rw-r--r-- | app/Controllers/Http/ServiceController.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/Controllers/Http/ServiceController.js b/app/Controllers/Http/ServiceController.js index 1dfec49..7162268 100644 --- a/app/Controllers/Http/ServiceController.js +++ b/app/Controllers/Http/ServiceController.js | |||
@@ -93,7 +93,7 @@ class ServiceController { | |||
93 | spellcheckerLanguage: '', | 93 | spellcheckerLanguage: '', |
94 | workspaces: [], | 94 | workspaces: [], |
95 | iconUrl: null, | 95 | iconUrl: null, |
96 | ...JSON.parse(service.settings), | 96 | ...typeof service.settings === "string" ? JSON.parse(service.settings) : service.settings, |
97 | id: service.serviceId, | 97 | id: service.serviceId, |
98 | name: service.name, | 98 | name: service.name, |
99 | recipeId: service.recipeId, | 99 | recipeId: service.recipeId, |
@@ -138,7 +138,7 @@ class ServiceController { | |||
138 | .where('userId', auth.user.id).fetch()).rows[0]; | 138 | .where('userId', auth.user.id).fetch()).rows[0]; |
139 | 139 | ||
140 | const settings = { | 140 | const settings = { |
141 | ...JSON.parse(serviceData.settings), | 141 | ...typeof serviceData.settings === "string" ? JSON.parse(serviceData.settings) : serviceData.settings, |
142 | ...data, | 142 | ...data, |
143 | }; | 143 | }; |
144 | 144 | ||
@@ -177,7 +177,7 @@ class ServiceController { | |||
177 | .where('userId', auth.user.id).fetch()).rows[0]; | 177 | .where('userId', auth.user.id).fetch()).rows[0]; |
178 | 178 | ||
179 | const settings = { | 179 | const settings = { |
180 | ...JSON.parse(serviceData.settings), | 180 | ...typeof serviceData.settings === "string" ? JSON.parse(serviceData.settings) : serviceData.settings, |
181 | order: data[service], | 181 | order: data[service], |
182 | }; | 182 | }; |
183 | 183 | ||
@@ -205,7 +205,7 @@ class ServiceController { | |||
205 | spellcheckerLanguage: '', | 205 | spellcheckerLanguage: '', |
206 | workspaces: [], | 206 | workspaces: [], |
207 | iconUrl: null, | 207 | iconUrl: null, |
208 | ...JSON.parse(service.settings), | 208 | ...typeof service.settings === "string" ? JSON.parse(service.settings) : service.settings, |
209 | id: service.serviceId, | 209 | id: service.serviceId, |
210 | name: service.name, | 210 | name: service.name, |
211 | recipeId: service.recipeId, | 211 | recipeId: service.recipeId, |