persistence draft

Persisting individual media file objects
This commit is contained in:
Cássio Zen
2016-06-06 21:53:22 -03:00
parent a0be4e0ae8
commit 83d03c63ec
10 changed files with 162 additions and 36 deletions

View File

@ -1,7 +1,7 @@
import React from 'react';
import { connect } from 'react-redux';
import { Map } from 'immutable';
import { loadEntry } from '../actions/entries';
import { loadEntry, persist } from '../actions/entries';
import { selectEntry } from '../reducers/entries';
import EntryEditor from '../components/EntryEditor';
@ -9,6 +9,12 @@ class EntryPage extends React.Component {
constructor(props) {
super(props);
this.props.dispatch(loadEntry(props.collection, props.slug));
this.handlePersist = this.handlePersist.bind(this);
}
handlePersist(entry, mediaFiles) {
this.props.dispatch(persist(this.props.collection, entry, mediaFiles));
}
render() {
@ -21,6 +27,7 @@ class EntryPage extends React.Component {
<EntryEditor
entry={entry || new Map()}
collection={collection}
onPersist={this.handlePersist}
/>
);
}