aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/server/ServerApi.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2017-12-04 16:46:42 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2017-12-04 16:46:42 +0100
commit1f3df7365bdbe34d1998adc30281a16b5a7b5e31 (patch)
tree1a77ff4b67c52453a5a8e7ab67799dd088f94242 /src/api/server/ServerApi.js
parentfix(Shortcuts): Fix service shortcuts for disabled but shown services (@joses... (diff)
downloadferdium-app-1f3df7365bdbe34d1998adc30281a16b5a7b5e31.tar.gz
ferdium-app-1f3df7365bdbe34d1998adc30281a16b5a7b5e31.tar.zst
ferdium-app-1f3df7365bdbe34d1998adc30281a16b5a7b5e31.zip
feat(Account): Enable a user to delete their own account
Diffstat (limited to 'src/api/server/ServerApi.js')
-rw-r--r--src/api/server/ServerApi.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/api/server/ServerApi.js b/src/api/server/ServerApi.js
index f25f02eaa..644bf20cd 100644
--- a/src/api/server/ServerApi.js
+++ b/src/api/server/ServerApi.js
@@ -125,6 +125,19 @@ export default class ServerApi {
125 return user; 125 return user;
126 } 126 }
127 127
128 async deleteAccount() {
129 const request = await window.fetch(`${SERVER_URL}/${API_VERSION}/me`, this._prepareAuthRequest({
130 method: 'DELETE',
131 }));
132 if (!request.ok) {
133 throw request;
134 }
135 const data = await request.json();
136
137 console.debug('ServerApi::deleteAccount resolves', data);
138 return data;
139 }
140
128 // Services 141 // Services
129 async getServices() { 142 async getServices() {
130 const request = await window.fetch(`${SERVER_URL}/${API_VERSION}/me/services`, this._prepareAuthRequest({ 143 const request = await window.fetch(`${SERVER_URL}/${API_VERSION}/me/services`, this._prepareAuthRequest({