mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-25 16:59:17 +01:00
react to cipher import api change
This commit is contained in:
parent
35bdc82243
commit
4cf404d9c3
@ -21,6 +21,13 @@
|
||||
del: { method: 'DELETE', params: { id: '@id' } }
|
||||
});
|
||||
|
||||
_service.ciphers = $resource(_apiUri + '/ciphers/:id', {}, {
|
||||
get: { method: 'GET', params: { id: '@id' } },
|
||||
list: { method: 'GET', params: {} },
|
||||
'import': { url: _apiUri + '/ciphers/import', method: 'POST', params: {} },
|
||||
del: { method: 'DELETE', params: { id: '@id' } }
|
||||
});
|
||||
|
||||
_service.accounts = $resource(_apiUri + '/accounts', {}, {
|
||||
register: { url: _apiUri + '/accounts/register', method: 'POST', params: {} },
|
||||
emailToken: { url: _apiUri + '/accounts/email-token', method: 'POST', params: {} },
|
||||
|
@ -24,7 +24,7 @@
|
||||
complete: function (results) {
|
||||
var folders = [],
|
||||
sites = [],
|
||||
siteRelationships = [];
|
||||
folderRelationships = [];
|
||||
|
||||
angular.forEach(results.data, function (value, key) {
|
||||
if (!value.uri || value.uri === '') {
|
||||
@ -65,11 +65,11 @@
|
||||
key: siteIndex,
|
||||
value: folderIndex
|
||||
};
|
||||
siteRelationships.push(relationship);
|
||||
folderRelationships.push(relationship);
|
||||
}
|
||||
});
|
||||
|
||||
success(folders, sites, siteRelationships);
|
||||
success(folders, sites, folderRelationships);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -10,11 +10,11 @@
|
||||
importService.import(model.source, file, importSuccess, importError);
|
||||
};
|
||||
|
||||
function importSuccess(folders, sites, siteRelationships) {
|
||||
apiService.accounts.import({
|
||||
function importSuccess(folders, sites, folderRelationships) {
|
||||
apiService.ciphers.import({
|
||||
folders: cipherService.encryptFolders(folders, cryptoService.getKey()),
|
||||
sites: cipherService.encryptSites(sites, cryptoService.getKey()),
|
||||
siteRelationships: siteRelationships
|
||||
folderRelationships: folderRelationships
|
||||
}, function () {
|
||||
$uibModalInstance.dismiss('cancel');
|
||||
$state.go('backend.vault').then(function () {
|
||||
|
Loading…
Reference in New Issue
Block a user