Added angularjs ShareService api methods

Fixed route method
This commit is contained in:
Marcos Zuriaga 2016-10-02 14:26:22 +02:00
parent ee919c1159
commit ea997a1ce0
No known key found for this signature in database
GPG key ID: 7D15585354D072FF
2 changed files with 13 additions and 1 deletions

View file

@ -51,7 +51,7 @@ return [
['name' => 'share#getVaultsByUser', 'url' => '/api/v2/sharing/vaults/{user_id}', 'verb' => 'GET'],
['name' => 'share#applyIntermediateShare', 'url' => '/api/v2/sharing/share', 'verb' => 'POST'],
['name' => 'share#savePendingRequest', 'url' => '/api/v2/sharing/save', 'verb' => 'POST'],
['name' => 'share#getPendingRequests', 'url' => '/api/v2/sharing/pending', 'verb' => 'POST'],
['name' => 'share#getPendingRequests', 'url' => '/api/v2/sharing/pending', 'verb' => 'GET'],
//Internal API

View file

@ -49,6 +49,18 @@ angular.module('passmanApp')
}
});
},
getPendingRequests: function () {
var queryUrl = OC.generateUrl('apps/passman/api/v2/sharing/pending');
return $http.get(queryUrl);
},
saveSharingRequest: function (request, crypted_shared_key) {
var queryUrl = OC.generateUrl('apps/passman/api/v2/sharing/save');
return $http.post(queryUrl, {
item_guid: request.item_guid,
target_vault_guid: request.target_vault_guid,
final_shared_key: crypted_shared_key
});
},
encryptSharedCredential: function(credential, sharedKey){
var _credential = angular.copy(credential);
var encrypted_fields = CredentialService.getEncryptedFields();