Storing more complete commit information on branch metadata

This commit is contained in:
Cássio Zen
2016-09-05 12:12:38 -03:00
parent 4a55bb0296
commit e852991954
3 changed files with 33 additions and 10 deletions

View File

@ -21,7 +21,7 @@ class Backend {
constructor(implementation, authStore = null) {
this.implementation = implementation;
this.authStore = authStore;
if (this.implementation == null) {
if (this.implementation === null) {
throw 'Cannot instantiate a Backend with no implementation';
}
}
@ -103,8 +103,13 @@ class Backend {
}
persistEntry(config, collection, entryDraft, MediaFiles) {
const newEntry = entryDraft.getIn(['entry', 'newRecord']) || false;
const parsedData = {
title: entryDraft.getIn(['entry', 'data', 'title'], 'No Title'),
description: entryDraft.getIn(['entry', 'data', 'description'], 'No Description'),
};
const entryData = entryDraft.getIn(['entry', 'data']).toJS();
let entryObj;
if (newEntry) {
@ -130,7 +135,9 @@ class Backend {
const collectionName = collection.get('name');
return this.implementation.persistEntry(entryObj, MediaFiles, { newEntry, commitMessage, collectionName, mode });
return this.implementation.persistEntry(entryObj, MediaFiles, {
newEntry, parsedData, commitMessage, collectionName, mode
});
}
entryToRaw(collection, entry) {