From ab07f2b9bd6e8436c929ab8b091c935c0bfa9064 Mon Sep 17 00:00:00 2001 From: brantje Date: Wed, 28 Sep 2016 21:21:58 +0200 Subject: [PATCH] Use patch --- js/app/services/vaultservice.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/js/app/services/vaultservice.js b/js/app/services/vaultservice.js index b546a71d..284c69e9 100644 --- a/js/app/services/vaultservice.js +++ b/js/app/services/vaultservice.js @@ -23,13 +23,6 @@ angular.module('passmanApp') }); }, setActiveVault: function(vault){ - this.getVaults().then(function(vaults){ - for(var v = 0; v < vaults.length; v++){ - if(vaults[v].vault_id == vault.vault_id){ - _activeVault = angular.merge(_activeVault, vaults[v]); - } - } - }); _activeVault = vault; }, getActiveVault: function(vault){ @@ -56,8 +49,12 @@ angular.module('passmanApp') }); }, updateVault: function (vault) { + var _vault = angular.copy(vault); + delete vault.defaultVaultPass; + delete vault.defaultVault; + var queryUrl = OC.generateUrl('apps/passman/api/v2/vaults/' + vault.vault_id); - return $http.post(queryUrl).then(function (response) { + return $http.patch(queryUrl).then(function (response) { if(response.data){ return response.data; } else {