From 7ea124f8b4594e950d09edf3cc08410276ce2a31 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Mon, 16 Nov 2020 18:12:44 -0500 Subject: [PATCH] pass adminEmail in fork request, put json object in fork instead of url params --- src/_services/network.service.js | 12 +++++++++--- src/_store/networks.module.js | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/_services/network.service.js b/src/_services/network.service.js index 03bb605..6d0fcaa 100644 --- a/src/_services/network.service.js +++ b/src/_services/network.service.js @@ -48,9 +48,15 @@ function startNetwork(userId, planId, cloud, region, exactRegion, messages, erro return fetch(`${config.apiUrl}/users/${userId}/networks/${planId}/actions/start${cloudAndRegion}`, util.postWithAuth()).then(util.handleCrudResponse(messages, errors)); } -function forkNetwork(userId, planId, forkHost, cloud, region, exactRegion, messages, errors) { - const cloudAndRegion = getCloudAndRegion(cloud, region, exactRegion); - return fetch(`${config.apiUrl}/users/${userId}/networks/${planId}/actions/fork/${forkHost}${cloudAndRegion}`, util.putWithAuth()).then(util.handleCrudResponse(messages, errors)); +function forkNetwork(userId, planId, forkHost, adminEmail, cloud, region, exactRegion, messages, errors) { + const forkRequest = { + fqdn: forkHost, + adminEmail: adminEmail, + cloud: cloud, + region: region, + exactRegion: exactRegion + }; + return fetch(`${config.apiUrl}/users/${userId}/networks/${planId}/actions/fork`, util.putWithAuth(forkRequest)).then(util.handleCrudResponse(messages, errors)); } function getStatusesByNetworkId(userId, networkId, messages, errors) { diff --git a/src/_store/networks.module.js b/src/_store/networks.module.js index 58e5f6a..8514f12 100644 --- a/src/_store/networks.module.js +++ b/src/_store/networks.module.js @@ -58,7 +58,7 @@ const actions = { .then( plan => { if (accountPlan.forkHost && accountPlan.forkHost !== '') { - networkService.forkNetwork(userId, plan.name, accountPlan.forkHost, cloud, region, exactRegion, messages, errors) + networkService.forkNetwork(userId, plan.name, accountPlan.forkHost, accountPlan.adminEmail, cloud, region, exactRegion, messages, errors) .then( newNodeNotification => commit('addPlanAndStartNetworkSuccess', newNodeNotification), error => commit('addPlanSuccessStartNetworkFailure', error)