mirror of
https://github.com/documize/community.git
synced 2025-07-24 07:39:43 +02:00
Replaced underscore.js & is.js with lodash.js
This commit is contained in:
parent
df8e843bf5
commit
566807bc14
93 changed files with 17379 additions and 2056 deletions
|
@ -56,7 +56,7 @@ export default Service.extend({
|
|||
// Returns all active users for organization.
|
||||
getAll() {
|
||||
return this.get('ajax').request(`users?active=1`).then((response) => {
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
return response.map((obj) => {
|
||||
let data = this.get('store').normalize('user', obj);
|
||||
|
@ -71,10 +71,10 @@ export default Service.extend({
|
|||
getComplete(filter, limit) {
|
||||
filter = filter.trim();
|
||||
if (filter.length > 0) filter = encodeURIComponent(filter);
|
||||
if (is.null(limit) || is.undefined(limit)) limit = 100;
|
||||
if (_.isNull(limit) || _.isUndefined(limit)) limit = 100;
|
||||
|
||||
return this.get('ajax').request(`users?active=0&filter=${filter}&limit=${limit}`).then((response) => {
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
return response.map((obj) => {
|
||||
let data = this.get('store').normalize('user', obj);
|
||||
|
@ -91,7 +91,7 @@ export default Service.extend({
|
|||
method: "GET"
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('user', obj);
|
||||
|
@ -170,7 +170,7 @@ export default Service.extend({
|
|||
|
||||
// matchUsers on firstname, lastname, email
|
||||
matchUsers(text, limit) {
|
||||
if (is.null(limit) || is.undefined(limit)) limit = 100;
|
||||
if (_.isNull(limit) || _.isUndefined(limit)) limit = 100;
|
||||
|
||||
return this.get('ajax').request(`users/match?limit=${limit}`, {
|
||||
method: 'POST',
|
||||
|
@ -179,7 +179,7 @@ export default Service.extend({
|
|||
data: text
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('user', obj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue