Merge branch 'fix-demo-ui' of github.com:netlify/netlify-cms into fix-demo-ui

This commit is contained in:
Cássio Zen
2016-10-28 11:42:38 -02:00
10 changed files with 128 additions and 6 deletions

View File

@ -153,16 +153,18 @@ class Backend {
throw (new Error('Not allowed to create new entries in this collection'));
}
const slug = slugFormatter(collection.get('slug'), entryDraft.getIn(['entry', 'data']));
const path = collectionModel.entryPath(slug);
entryObj = {
path: collectionModel.entryPath(slug),
path,
slug,
raw: this.entryToRaw(collection, entryData),
raw: this.entryToRaw(collection, Object.assign({ path }, entryData)),
};
} else {
const path = entryDraft.getIn(['entry', 'path']);
entryObj = {
path: entryDraft.getIn(['entry', 'path']),
path,
slug: entryDraft.getIn(['entry', 'slug']),
raw: this.entryToRaw(collection, entryData),
raw: this.entryToRaw(collection, Object.assign({ path }, entryData)),
};
}