Procházet zdrojové kódy

pass adminEmail in fork request, put json object in fork instead of url params

pull/73/head
Jonathan Cobb před 4 roky
rodič
revize
7ea124f8b4
2 změnil soubory, kde provedl 10 přidání a 4 odebrání
  1. +9
    -3
      src/_services/network.service.js
  2. +1
    -1
      src/_store/networks.module.js

+ 9
- 3
src/_services/network.service.js Zobrazit soubor

@@ -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)); 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) { function getStatusesByNetworkId(userId, networkId, messages, errors) {


+ 1
- 1
src/_store/networks.module.js Zobrazit soubor

@@ -58,7 +58,7 @@ const actions = {
.then( .then(
plan => { plan => {
if (accountPlan.forkHost && accountPlan.forkHost !== '') { 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( .then(
newNodeNotification => commit('addPlanAndStartNetworkSuccess', newNodeNotification), newNodeNotification => commit('addPlanAndStartNetworkSuccess', newNodeNotification),
error => commit('addPlanSuccessStartNetworkFailure', error) error => commit('addPlanSuccessStartNetworkFailure', error)


Načítá se…
Zrušit
Uložit