Small refactor preparing for branch creating/editing. Also closes #58
This commit is contained in:
@ -62,7 +62,6 @@ export function loadConfig(config) {
|
||||
|
||||
function parseConfig(data) {
|
||||
const config = yaml.safeLoad(data);
|
||||
|
||||
if (typeof CMS_ENV === 'string' && config[CMS_ENV]) {
|
||||
for (var key in config[CMS_ENV]) {
|
||||
if (config[CMS_ENV].hasOwnProperty(key)) {
|
||||
@ -70,5 +69,14 @@ function parseConfig(data) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ('media_folder' in config && typeof config.media_folder === 'string') {
|
||||
// Parse source & public paths for media folder.
|
||||
config.media_folder = {
|
||||
path: config.media_folder,
|
||||
public_path: config.media_folder
|
||||
};
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
@ -175,9 +175,8 @@ export function persistEntry(collection, entry) {
|
||||
const state = getState();
|
||||
const backend = currentBackend(state.config);
|
||||
const MediaProxies = entry.get('mediaFiles').map(path => getMedia(state, path));
|
||||
|
||||
dispatch(entryPersisting(collection, entry));
|
||||
backend.persistEntry(collection, entry, MediaProxies.toJS()).then(
|
||||
backend.persistEntry(state.config, collection, entry, MediaProxies.toJS()).then(
|
||||
() => {
|
||||
dispatch(entryPersisted(collection, entry));
|
||||
},
|
||||
|
Reference in New Issue
Block a user