diff options
author | 2019-09-07 15:50:23 +0200 | |
---|---|---|
committer | 2019-09-07 15:50:23 +0200 | |
commit | e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e (patch) | |
tree | b8314e4155503b135dcb07e8b4a0e847e25c19cf /src/api | |
parent | Update CHANGELOG.md (diff) | |
parent | Update CHANGELOG.md (diff) | |
download | ferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.tar.gz ferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.tar.zst ferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.zip |
Merge branch 'master' of https://github.com/meetfranz/franz into franz-5.3.0
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/UserApi.js | 4 | ||||
-rw-r--r-- | src/api/server/ServerApi.js | 16 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/api/UserApi.js b/src/api/UserApi.js index edfb88988..8ba8cd1e9 100644 --- a/src/api/UserApi.js +++ b/src/api/UserApi.js | |||
@@ -25,6 +25,10 @@ export default class UserApi { | |||
25 | return this.server.retrievePassword(email); | 25 | return this.server.retrievePassword(email); |
26 | } | 26 | } |
27 | 27 | ||
28 | activateTrial(data) { | ||
29 | return this.server.activateTrial(data); | ||
30 | } | ||
31 | |||
28 | invite(data) { | 32 | invite(data) { |
29 | return this.server.inviteUser(data); | 33 | return this.server.inviteUser(data); |
30 | } | 34 | } |
diff --git a/src/api/server/ServerApi.js b/src/api/server/ServerApi.js index efac5ca19..293fcda26 100644 --- a/src/api/server/ServerApi.js +++ b/src/api/server/ServerApi.js | |||
@@ -76,6 +76,20 @@ export default class ServerApi { | |||
76 | return u.token; | 76 | return u.token; |
77 | } | 77 | } |
78 | 78 | ||
79 | async activateTrial(data) { | ||
80 | const request = await sendAuthRequest(`${API_URL}/payment/trial`, { | ||
81 | method: 'POST', | ||
82 | body: JSON.stringify(data), | ||
83 | }); | ||
84 | if (!request.ok) { | ||
85 | throw request; | ||
86 | } | ||
87 | const trial = await request.json(); | ||
88 | |||
89 | debug('ServerApi::signup resolves', trial); | ||
90 | return true; | ||
91 | } | ||
92 | |||
79 | async inviteUser(data) { | 93 | async inviteUser(data) { |
80 | const request = await sendAuthRequest(`${apiBase()}/invite`, { | 94 | const request = await sendAuthRequest(`${apiBase()}/invite`, { |
81 | method: 'POST', | 95 | method: 'POST', |
@@ -468,7 +482,7 @@ export default class ServerApi { | |||
468 | return services; | 482 | return services; |
469 | } | 483 | } |
470 | } catch (err) { | 484 | } catch (err) { |
471 | throw (new Error('ServerApi::getLegacyServices no config found')); | 485 | console.error('ServerApi::getLegacyServices no config found'); |
472 | } | 486 | } |
473 | 487 | ||
474 | return []; | 488 | return []; |