aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/ServicesStore.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2018-11-27 18:06:14 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2018-11-27 18:06:14 +0100
commit62972747866740dae84fc7b519fcedd731572329 (patch)
tree3a74610caa47350ff6b3cc07482f8472f18c1764 /src/stores/ServicesStore.js
parentFix listening key (diff)
downloadferdium-app-62972747866740dae84fc7b519fcedd731572329.tar.gz
ferdium-app-62972747866740dae84fc7b519fcedd731572329.tar.zst
ferdium-app-62972747866740dae84fc7b519fcedd731572329.zip
feat(App): Add proxy support for services
Diffstat (limited to 'src/stores/ServicesStore.js')
-rw-r--r--src/stores/ServicesStore.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js
index cdb2db142..e22b343e7 100644
--- a/src/stores/ServicesStore.js
+++ b/src/stores/ServicesStore.js
@@ -143,6 +143,7 @@ export default class ServicesStore extends Store {
143 // Actions 143 // Actions
144 @action async _createService({ recipeId, serviceData, redirect = true }) { 144 @action async _createService({ recipeId, serviceData, redirect = true }) {
145 const data = this._cleanUpTeamIdAndCustomUrl(recipeId, serviceData); 145 const data = this._cleanUpTeamIdAndCustomUrl(recipeId, serviceData);
146
146 const response = await this.createServiceRequest.execute(recipeId, data)._promise; 147 const response = await this.createServiceRequest.execute(recipeId, data)._promise;
147 148
148 this.allServicesRequest.patch((result) => { 149 this.allServicesRequest.patch((result) => {
@@ -150,6 +151,13 @@ export default class ServicesStore extends Store {
150 result.push(response.data); 151 result.push(response.data);
151 }); 152 });
152 153
154 this.actions.settings.update({
155 type: 'proxy',
156 data: {
157 [`${response.data.id}`]: data.proxy,
158 },
159 });
160
153 this.actionStatus = response.status || []; 161 this.actionStatus = response.status || [];
154 162
155 if (redirect) { 163 if (redirect) {
@@ -222,6 +230,13 @@ export default class ServicesStore extends Store {
222 }); 230 });
223 } 231 }
224 232
233 this.actions.settings.update({
234 type: 'proxy',
235 data: {
236 [`${serviceId}`]: data.proxy,
237 },
238 });
239
225 if (redirect) { 240 if (redirect) {
226 this.stores.router.push('/settings/services'); 241 this.stores.router.push('/settings/services');
227 gaEvent('Service', 'update', service.recipe.id); 242 gaEvent('Service', 'update', service.recipe.id);