diff options
author | 2021-10-02 09:24:32 +0200 | |
---|---|---|
committer | 2021-10-02 09:24:32 +0200 | |
commit | bfe8847d72cd0893230f2e654242658214943e61 (patch) | |
tree | 3384b02ebad7a74cbb106ddd95546e0e24ff0bb8 /src/api/UserApi.js | |
parent | fix: Fix navigation shortcut accelerator for non-macos (fixes #1172) (#2012) (diff) | |
download | ferdium-app-bfe8847d72cd0893230f2e654242658214943e61.tar.gz ferdium-app-bfe8847d72cd0893230f2e654242658214943e61.tar.zst ferdium-app-bfe8847d72cd0893230f2e654242658214943e61.zip |
chore: convert various files from JS to TS (#2010)
Diffstat (limited to 'src/api/UserApi.js')
-rw-r--r-- | src/api/UserApi.js | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/api/UserApi.js b/src/api/UserApi.js deleted file mode 100644 index edfb88988..000000000 --- a/src/api/UserApi.js +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | import { hash } from '../helpers/password-helpers'; | ||
2 | |||
3 | export default class UserApi { | ||
4 | constructor(server, local) { | ||
5 | this.server = server; | ||
6 | this.local = local; | ||
7 | } | ||
8 | |||
9 | login(email, password) { | ||
10 | return this.server.login(email, hash(password)); | ||
11 | } | ||
12 | |||
13 | logout() { | ||
14 | return this; | ||
15 | } | ||
16 | |||
17 | signup(data) { | ||
18 | Object.assign(data, { | ||
19 | password: hash(data.password), | ||
20 | }); | ||
21 | return this.server.signup(data); | ||
22 | } | ||
23 | |||
24 | password(email) { | ||
25 | return this.server.retrievePassword(email); | ||
26 | } | ||
27 | |||
28 | invite(data) { | ||
29 | return this.server.inviteUser(data); | ||
30 | } | ||
31 | |||
32 | getInfo() { | ||
33 | return this.server.userInfo(); | ||
34 | } | ||
35 | |||
36 | updateInfo(data) { | ||
37 | const userData = data; | ||
38 | if (userData.oldPassword && userData.newPassword) { | ||
39 | userData.oldPassword = hash(userData.oldPassword); | ||
40 | userData.newPassword = hash(userData.newPassword); | ||
41 | } | ||
42 | |||
43 | return this.server.updateUserInfo(userData); | ||
44 | } | ||
45 | |||
46 | getLegacyServices() { | ||
47 | return this.server.getLegacyServices(); | ||
48 | } | ||
49 | |||
50 | delete() { | ||
51 | return this.server.deleteAccount(); | ||
52 | } | ||
53 | } | ||