1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-04 13:05:23 +02:00
This commit is contained in:
zinyando 2016-08-16 13:34:09 +02:00
parent 6121e640d8
commit a63a6cd709
10 changed files with 64 additions and 34 deletions

View file

@ -253,6 +253,10 @@ export default Ember.Service.extend({
}).then((response) => {
let data = [];
if (isObject(response)) {
return data;
}
data = response.map((obj) => {
let data = this.get('store').normalize('attachment', obj);
return this.get('store').push({ data: data });
@ -270,3 +274,7 @@ export default Ember.Service.extend({
});
},
});
function isObject(a) {
return (!!a) && (a.constructor === Object);
}