Moved draft state for an entry (when in edit mode) to Redux

This commit is contained in:
Cássio Zen
2016-06-08 04:42:24 -03:00
parent 2d48743f37
commit 9275aaec90
11 changed files with 206 additions and 112 deletions

View File

@ -67,15 +67,16 @@ class Backend {
};
}
persist(collection, entry, mediaFiles) {
const entryData = entry.get('data').toJS();
persist(collection, entryDraft) {
const entryData = entryDraft.getIn(['entry', 'data']).toJS();
const entryObj = {
path: entry.get('path'),
slug: entry.get('slug'),
path: entryDraft.getIn(['entry', 'path']),
slug: entryDraft.getIn(['entry', 'slug']),
raw: this.entryToRaw(collection, entryData)
};
return this.implementation.persist(collection, entryObj, mediaFiles.toJS());
return this.implementation.persist(collection, entryObj, entryDraft.get('mediaFiles').toJS());
}
entryToRaw(collection, entry) {