Przeglądaj źródła

Use POST HTTP method for restore API calls

pull/44/head
Kristijan Mitrovic 4 lat temu
rodzic
commit
dfef5be489
1 zmienionych plików z 3 dodań i 7 usunięć
  1. +3
    -7
      src/_services/user.service.js

+ 3
- 7
src/_services/user.service.js Wyświetl plik

@@ -69,12 +69,8 @@ function appLogin(session, messages, errors) {
}

function restore(shortKey, longKey, password, messages, errors) {
const requestOptions = {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ 'data': longKey, 'password': password })
};
return fetch(`${config.apiUrl}/auth/restore/${shortKey}`, requestOptions)
return fetch(`${config.apiUrl}/auth/restore/${shortKey}`,
util.postWithAuth({ 'data': longKey, 'password': password }))
.then(handleAuthResponse(messages, errors));
}

@@ -82,7 +78,7 @@ function restoreFromPackage(shortKey, backupFileRef, password, messages, errors)
let formData = new FormData();
formData.append('file', backupFileRef);
formData.append('password', password);
return fetch(`${config.apiUrl}/auth/restore/apply/${shortKey}`, util.putWithAuth(formData))
return fetch(`${config.apiUrl}/auth/restore/apply/${shortKey}`, util.postWithAuth(formData))
.then(util.handleAuthResponse(messages, errors));
}



Ładowanie…
Anuluj
Zapisz