1
0
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:
Kyle Spearrin 2016-06-07 20:05:49 -04:00
parent 35bdc82243
commit 4cf404d9c3
3 changed files with 13 additions and 6 deletions

View File

@ -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: {} },

View File

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

View File

@ -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 () {