mediaFiles backend persistence structure
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user