persistence draft
Persisting individual media file objects
This commit is contained in:
@ -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}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user