mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-26 15:40:32 +00:00
Enable search by fullname and email
This commit is contained in:
committed by
Francis Lachapelle
parent
7e43b13f21
commit
5b83b0c7b6
@@ -0,0 +1,28 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function User() {}
|
||||
|
||||
/* The factory we'll use to register with Angular */
|
||||
User.factory = ['sgSettings', 'sgResource', function(Settings, Resource) {
|
||||
angular.extend(User, {
|
||||
$$resource: new Resource(Settings.baseURL)
|
||||
});
|
||||
|
||||
return User; // return constructor
|
||||
}];
|
||||
|
||||
/* Factory registration in Angular module */
|
||||
angular.module('SOGo.Common').factory('sgUser', User.factory);
|
||||
|
||||
/* Instance methods
|
||||
* Public method, assigned to prototype
|
||||
*/
|
||||
User.prototype.$filter = function(search) {
|
||||
// return a collections of users for a filter
|
||||
var param = {search: search};
|
||||
return User.$$resource.fetch(null, "usersSearch", param).then(function(results) {
|
||||
return results;
|
||||
})
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user