aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/ServicesStore.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2017-12-27 13:09:17 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2017-12-27 13:09:17 +0100
commit150cfe764aeb9e93341ba2f231fd121fe85472af (patch)
treebc398a878ec736f666502af983160aa7829a7a3d /src/stores/ServicesStore.js
parentMerge branch 'develop' into feature/icon-upload (diff)
downloadferdium-app-150cfe764aeb9e93341ba2f231fd121fe85472af.tar.gz
ferdium-app-150cfe764aeb9e93341ba2f231fd121fe85472af.tar.zst
ferdium-app-150cfe764aeb9e93341ba2f231fd121fe85472af.zip
First working draft of icon upload
Diffstat (limited to 'src/stores/ServicesStore.js')
-rw-r--r--src/stores/ServicesStore.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js
index 66f37af26..4fb5c9767 100644
--- a/src/stores/ServicesStore.js
+++ b/src/stores/ServicesStore.js
@@ -172,9 +172,21 @@ export default class ServicesStore extends Store {
172 const data = this._cleanUpTeamIdAndCustomUrl(service.recipe.id, serviceData); 172 const data = this._cleanUpTeamIdAndCustomUrl(service.recipe.id, serviceData);
173 const request = this.updateServiceRequest.execute(serviceId, data); 173 const request = this.updateServiceRequest.execute(serviceId, data);
174 174
175 const newData = serviceData;
176 if (serviceData.iconFile) {
177 await request._promise;
178
179 newData.iconUrl = request.result.data.iconUrl;
180 }
181
175 this.allServicesRequest.patch((result) => { 182 this.allServicesRequest.patch((result) => {
176 if (!result) return; 183 if (!result) return;
177 Object.assign(result.find(c => c.id === serviceId), serviceData); 184
185 if (data.customIcon === 'delete') {
186 data.iconUrl = '';
187 }
188
189 Object.assign(result.find(c => c.id === serviceId), newData);
178 }); 190 });
179 191
180 await request._promise; 192 await request._promise;