mediaFiles backend persistence structure

This commit is contained in:
Cássio Zen
2016-06-10 18:48:38 -03:00
parent 1700f98e4e
commit 6ed7e78642
5 changed files with 22 additions and 10 deletions

View File

@ -83,12 +83,12 @@ function entryPersisting(collection, entry) {
};
}
function entryPersisted(collection, entry) {
function entryPersisted(persistedEntry, persistedMediaFiles) {
return {
type: ENTRY_PERSIST_SUCCESS,
payload: {
collection: collection,
entry: entry
persistedEntry: persistedEntry,
persistedMediaFiles: persistedMediaFiles
}
};
}
@ -158,7 +158,9 @@ export function persist(collection, entry, mediaFiles) {
const backend = currentBackend(state.config);
dispatch(entryPersisting(collection, entry));
backend.persist(collection, entry, mediaFiles).then(
(entry) => dispatch(entryPersisted(collection, entry)),
({persistedEntry, persistedMediaFiles}) => {
dispatch(entryPersisted(persistedEntry, persistedMediaFiles));
},
(error) => dispatch(entryPersistFail(collection, entry, error))
);
};