Support for object widget

This commit is contained in:
Mathias Biilmann Christensen
2016-10-28 04:51:37 +02:00
parent 442a02f009
commit 6b73c39ba8
9 changed files with 125 additions and 5 deletions

View File

@ -154,16 +154,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)),
};
}