From 115d8dc7029fff39994052fe51693509f035b489 Mon Sep 17 00:00:00 2001 From: vantezzen Date: Sun, 20 Oct 2019 18:05:43 +0200 Subject: Fix user settings --- app/Controllers/Http/UserController.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'app/Controllers/Http/UserController.js') diff --git a/app/Controllers/Http/UserController.js b/app/Controllers/Http/UserController.js index 3f6103a..2a35f93 100644 --- a/app/Controllers/Http/UserController.js +++ b/app/Controllers/Http/UserController.js @@ -133,6 +133,8 @@ class UserController { response.send('Missing or invalid api token'); } + const settings = typeof auth.user.settings === 'string' ? JSON.parse(auth.user.settings) : auth.user.settings; + return response.send({ accountType: 'individual', beta: false, @@ -146,7 +148,7 @@ class UserController { isSubscriptionOwner: true, lastname: 'Franz', locale: 'en-US', - ...auth.user.settings || {}, + ...settings || {}, }); } @@ -169,7 +171,19 @@ class UserController { await auth.user.save(); return response.send({ - status: 'success' + accountType: 'individual', + beta: false, + donor: {}, + email: auth.user.email, + emailValidated: true, + features: {}, + firstname: 'Franz', + id: '82c1cf9d-ab58-4da2-b55e-aaa41d2142d8', + isPremium: true, + isSubscriptionOwner: true, + lastname: 'Franz', + locale: 'en-US', + ...newSettings || {}, }); } -- cgit v1.2.3-70-g09d2