1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-04 21:15:24 +02:00

Default to empty array results in Ember services

This commit is contained in:
McMatts 2018-03-23 11:50:21 +00:00
parent 38e8c4665a
commit 8d65c2d571
10 changed files with 36 additions and 11 deletions

View file

@ -36,6 +36,7 @@ export default BaseService.extend({
method: 'GET'
}).then((response) => {
let data = [];
if (is.not.array(response)) response = [];
data = response.map((obj) => {
let data = this.get('store').normalize('category', obj);
@ -52,6 +53,7 @@ export default BaseService.extend({
method: 'GET'
}).then((response) => {
let data = [];
if (is.not.array(response)) response = [];
data = response.map((obj) => {
let data = this.get('store').normalize('category', obj);
@ -89,6 +91,7 @@ export default BaseService.extend({
}).then((response) => {
// return response;
let data = [];
if (is.not.array(response)) response = [];
data = response.map((obj) => {
let data = this.get('store').normalize('category-permission', obj);
@ -105,6 +108,7 @@ export default BaseService.extend({
method: 'GET'
}).then((response) => {
let data = [];
if (is.not.array(response)) response = [];
data = response.map((obj) => {
let data = this.get('store').normalize('user', obj);
@ -173,6 +177,7 @@ export default BaseService.extend({
membership: [],
summary: []
};
if (is.not.array(response)) response = [];
let cats = response.category.map((obj) => {
let data = this.get('store').normalize('category', obj);