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

Create attachment model and push attachment data into store

This commit is contained in:
zinyando 2016-08-11 14:38:36 +02:00
parent d47f1e11b8
commit b638d6a114
5 changed files with 67 additions and 49 deletions

View file

@ -256,9 +256,9 @@ export default Ember.Service.extend({
method: 'GET'
}).then((response) => {
let data = [];
_.each(response, function (obj) {
let data = this.get('store').normalize('attachment', obj);
let attachments = this.get('store').push({ data: data });
_.each(response, (obj) => {
let attachmentData = this.get('store').normalize('attachment', obj);
let attachments = this.get('store').push({ data: attachmentData });
data.pushObject(attachments);
});
return data;