Explorar el Código

Fix parsing of downloading network key

pull/16/head
Kristijan Mitrovic hace 4 años
padre
commit
cf9d226c90
Se han modificado 2 ficheros con 4 adiciones y 2 borrados
  1. +3
    -1
      src/_services/network.service.js
  2. +1
    -1
      src/_store/networks.module.js

+ 3
- 1
src/_services/network.service.js Ver fichero

@@ -80,9 +80,11 @@ function requestNetworkKeys(userId, networkId, messages, errors) {
return fetch(`${config.apiUrl}/users/${userId}/networks/${networkId}/actions/keys`, util.getWithAuth()).then(util.handleCrudResponse(messages, errors));
}

function retrieveNetworkKeys(userId, networkId, code, password) {
function retrieveNetworkKeys(userId, networkId, code, password, messages, errors) {
return fetch(`${config.apiUrl}/users/${userId}/networks/${networkId}/actions/keys/${code}`,
util.postWithAuth({ name: 'password', value: password }))
.then(util.handleCrudResponse(messages, errors))
.then(netKeyObj => netKeyObj.data)
.then(util.handleDataToDownloadAsFile('restore.' + networkId + '.key', 'text/plain'));
}



+ 1
- 1
src/_store/networks.module.js Ver fichero

@@ -149,7 +149,7 @@ const actions = {

retrieveNetworkKeys({ commit }, {userId, networkId, code, password, messages, errors}) {
commit('retrieveNetworkKeysRequest');
networkService.retrieveNetworkKeys(userId, networkId, code, password)
networkService.retrieveNetworkKeys(userId, networkId, code, password, messages, errors)
.then(ok => commit('retrieveNetworkKeysSuccess'),
error => commit('retrieveNetworkKeysFailure', error));
},


Cargando…
Cancelar
Guardar