passman/js/app/services/shareservice.js

25 lines
553 B
JavaScript

'use strict';
/**
* @ngdoc service
* @name passmanApp.ShareService
* @description
* # ShareService
* Service in the passmanApp.
*/
angular.module('passmanApp')
.service('ShareService', ['$http', function ($http) {
var _tags = [];
return {
search: function (string) {
var queryUrl = OC.generateUrl('apps/passman/api/v2/sharing/search');
return $http.post(queryUrl, {search: string}).then(function (response) {
if (response.data) {
return response.data;
} else {
return response;
}
});
}
}
}]);