From 42249cd8721e0cfb2bbfbe66062e6c905a931434 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Wed, 10 Jan 2018 12:57:44 +0100 Subject: Fix issue with custom icon on service creation --- src/api/server/ServerApi.js | 6 +++--- src/stores/ServicesStore.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/api/server/ServerApi.js b/src/api/server/ServerApi.js index a684ff98b..d37ff51f8 100644 --- a/src/api/server/ServerApi.js +++ b/src/api/server/ServerApi.js @@ -173,9 +173,9 @@ export default class ServerApi { const serviceData = await request.json(); if (data.iconFile) { - const iconUrl = await this.uploadServiceIcon(serviceData.data.id, data.iconFile); + const iconData = await this.uploadServiceIcon(serviceData.data.id, data.iconFile); - serviceData.data.iconUrl = iconUrl; + serviceData.data = iconData; } const service = Object.assign(serviceData, { data: await this._prepareServiceModel(serviceData.data) }); @@ -227,7 +227,7 @@ export default class ServerApi { const serviceData = await request.json(); - return serviceData.data.iconUrl; + return serviceData.data; } async reorderService(data) { diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 7300a76c8..20e07e540 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js @@ -187,13 +187,13 @@ export default class ServicesStore extends Store { // patch custom icon deletion if (data.customIcon === 'delete') { - data.iconUrl = ''; - data.hasCustomUploadedIcon = false; + newData.iconUrl = ''; + newData.hasCustomUploadedIcon = false; } // patch custom icon url if (data.customIconUrl) { - data.iconUrl = data.customIconUrl; + newData.iconUrl = data.customIconUrl; } Object.assign(result.find(c => c.id === serviceId), newData); -- cgit v1.2.3-54-g00ecf