aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/server
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2017-12-05 14:05:32 +0100
committerLibravatar GitHub <noreply@github.com>2017-12-05 14:05:32 +0100
commit1d33a1784bea940906bc74e335668920fa1b88f6 (patch)
treeb1eb91d83bf8e0d442994b3223ea79cbb123243a /src/api/server
parentMerge pull request #402 from meetfranz/feature/welcome-styles (diff)
parentfeat(Account): Enable a user to delete their own account (diff)
downloadferdium-app-1d33a1784bea940906bc74e335668920fa1b88f6.tar.gz
ferdium-app-1d33a1784bea940906bc74e335668920fa1b88f6.tar.zst
ferdium-app-1d33a1784bea940906bc74e335668920fa1b88f6.zip
Merge pull request #400 from meetfranz/feature/delete-account
[PR] Enable a user to delete their own account
Diffstat (limited to 'src/api/server')
-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({