diff options
Diffstat (limited to 'app/Controllers/Http/DashboardController.js')
-rw-r--r-- | app/Controllers/Http/DashboardController.js | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/app/Controllers/Http/DashboardController.js b/app/Controllers/Http/DashboardController.js index 86cfa74..a47beb6 100644 --- a/app/Controllers/Http/DashboardController.js +++ b/app/Controllers/Http/DashboardController.js | |||
@@ -134,6 +134,7 @@ class DashboardController { | |||
134 | mail: general.email, | 134 | mail: general.email, |
135 | created: general.created_at, | 135 | created: general.created_at, |
136 | updated: general.updated_at, | 136 | updated: general.updated_at, |
137 | stringify: JSON.stringify, | ||
137 | services, | 138 | services, |
138 | workspaces, | 139 | workspaces, |
139 | }); | 140 | }); |
@@ -165,6 +166,7 @@ class DashboardController { | |||
165 | request, | 166 | request, |
166 | session, | 167 | session, |
167 | response, | 168 | response, |
169 | view, | ||
168 | }) { | 170 | }) { |
169 | const validation = await validateAll(request.all(), { | 171 | const validation = await validateAll(request.all(), { |
170 | file: 'required', | 172 | file: 'required', |
@@ -210,7 +212,10 @@ class DashboardController { | |||
210 | } | 212 | } |
211 | } catch (e) { | 213 | } catch (e) { |
212 | const errorMessage = `Could not import your services into our system.\nError: ${e}`; | 214 | const errorMessage = `Could not import your services into our system.\nError: ${e}`; |
213 | return response.status(401).send(errorMessage); | 215 | return view.render('others.message', { |
216 | heading: 'Error while importing', | ||
217 | text: errorMessage, | ||
218 | }); | ||
214 | } | 219 | } |
215 | 220 | ||
216 | // Import workspaces | 221 | // Import workspaces |
@@ -234,10 +239,16 @@ class DashboardController { | |||
234 | } | 239 | } |
235 | } catch (e) { | 240 | } catch (e) { |
236 | const errorMessage = `Could not import your workspaces into our system.\nError: ${e}`; | 241 | const errorMessage = `Could not import your workspaces into our system.\nError: ${e}`; |
237 | return response.status(401).send(errorMessage); | 242 | return view.render('others.message', { |
243 | heading: 'Error while importing', | ||
244 | text: errorMessage, | ||
245 | }); | ||
238 | } | 246 | } |
239 | 247 | ||
240 | return response.send('Your account has been imported.'); | 248 | return view.render('others.message', { |
249 | heading: 'Successfully imported', | ||
250 | text: 'Your account has been imported, you can now login as usual!', | ||
251 | }); | ||
241 | } | 252 | } |
242 | 253 | ||
243 | logout({ | 254 | logout({ |