mediaFiles backend persistence structure

This commit is contained in:
Cássio Zen
2016-06-10 18:48:38 -03:00
parent 1700f98e4e
commit 6ed7e78642
5 changed files with 22 additions and 10 deletions

View File

@ -68,15 +68,18 @@ class Backend {
}
persist(collection, entryDraft) {
const entryData = entryDraft.getIn(['entry', 'data']).toJS();
const entryData = entryDraft.getIn(['entry', 'data']).toObject();
const entryObj = {
path: entryDraft.getIn(['entry', 'path']),
slug: entryDraft.getIn(['entry', 'slug']),
raw: this.entryToRaw(collection, entryData)
};
return this.implementation.persist(collection, entryObj, entryDraft.get('mediaFiles').toJS());
return this.implementation.persist(collection, entryObj, entryDraft.get('mediaFiles').toJS()).then(
(response) => ({
persistedEntry: this.entryWithFormat(collection)(response.persistedEntry),
persistedMediaFiles:response.persistedMediaFiles
})
);
}
entryToRaw(collection, entry) {