mirror of
https://github.com/documize/community.git
synced 2025-07-25 08:09:43 +02:00
Default to empty array results in Ember services
This commit is contained in:
parent
38e8c4665a
commit
8d65c2d571
10 changed files with 36 additions and 11 deletions
|
@ -24,6 +24,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('section', obj);
|
||||
|
@ -55,6 +56,7 @@ export default BaseService.extend({
|
|||
method: 'GET'
|
||||
}).then((response) => {
|
||||
let pages = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
|
||||
if (is.not.null(response) && is.array(response) && response.length > 0) {
|
||||
pages = response.map((page) => {
|
||||
|
@ -103,6 +105,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('block', obj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue