1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 15:19:42 +02:00

add/remove group membership

This commit is contained in:
sauls8t 2018-03-01 19:14:27 +00:00
parent 0b5ed8fd9e
commit ed11c0ad11
17 changed files with 287 additions and 87 deletions

View file

@ -64,8 +64,13 @@ export default Service.extend({
},
// Returns all active and inactive users for organization.
getComplete() {
return this.get('ajax').request(`users?active=0`).then((response) => {
// Only available for admins and limits results to max. 100 users.
// Takes filter for user search criteria.
getComplete(filter) {
filter = filter.trim();
if (filter.length > 0) filter = encodeURIComponent(filter);
return this.get('ajax').request(`users?active=0&filter=${filter}`).then((response) => {
return response.map((obj) => {
let data = this.get('store').normalize('user', obj);
return this.get('store').push(data);