mirror of
https://github.com/documize/community.git
synced 2025-08-04 13:05:23 +02:00
Clean up
This commit is contained in:
parent
6121e640d8
commit
a63a6cd709
10 changed files with 64 additions and 34 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue