Przeglądaj źródła

Fix parsing of downloading network key

pull/16/head
Kristijan Mitrovic 4 lat temu
rodzic
commit
cf9d226c90
2 zmienionych plików z 4 dodań i 2 usunięć
  1. +3
    -1
      src/_services/network.service.js
  2. +1
    -1
      src/_store/networks.module.js

+ 3
- 1
src/_services/network.service.js Wyświetl plik

@@ -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 Wyświetl plik

@@ -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));
},


Ładowanie…
Anuluj
Zapisz