mirror of
https://github.com/nextcloud/passman.git
synced 2026-01-06 23:57:12 +08:00
Add method to service
This commit is contained in:
parent
f80263dff0
commit
6a38da7698
2 changed files with 14 additions and 0 deletions
|
|
@ -282,6 +282,8 @@ angular.module('passmanApp')
|
|||
// To update a file you can use the FileService.updateFile
|
||||
|
||||
//@TODO Update revisions with new key (async)
|
||||
// With CredentialService.getRevisions we can get the revisions.
|
||||
// Then we can update them using CredentialService.updateRevision
|
||||
|
||||
var list = $scope.share_settings.credentialSharedWithUserAndGroup;
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
|
|
|
|||
|
|
@ -139,6 +139,18 @@ angular.module('passmanApp')
|
|||
}
|
||||
});
|
||||
},
|
||||
updateRevision: function(revision){
|
||||
var _revision = angular.copy(revision);
|
||||
_revision.revision_data = window.btoa(_revision.revision_data);
|
||||
var queryUrl = OC.generateUrl('apps/passman/api/v2/credentials/' + id + '/revision/' + revision.id);
|
||||
return $http.patch(queryUrl, revision).then(function (response) {
|
||||
if (response.data) {
|
||||
return response.data;
|
||||
} else {
|
||||
return response;
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteRevision: function(credential_id, revision_id){
|
||||
var queryUrl = OC.generateUrl('apps/passman/api/v2/credentials/' + credential_id + '/revision/' + revision_id);
|
||||
return $http.delete(queryUrl).then(function (response) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue