client/src/components/Session.js
changeset 62 b2514a9bcd49
parent 59 1eb52770eefa
child 63 4088f8dc6b52
--- a/client/src/components/Session.js	Tue Jun 20 12:11:57 2017 +0200
+++ b/client/src/components/Session.js	Tue Jun 20 14:13:15 2017 +0200
@@ -12,10 +12,6 @@
 
 class Session extends Component {
 
-  componentDidMount = () => {
-    this.props.notesActions.loadNotesBySession({ _id: this.props.match.params.id });
-  }
-
   render() {
     return (
       <div>
@@ -50,14 +46,18 @@
 
   const sessionId = props.match.params.id;
 
-  const sessions = state.get('sessions');
-  const notes = state.get('notes');
+  const sessions = state['sessions'];
+  const notes = state['notes'];
+
   const currentSession = sessions.find(session => session._id === sessionId);
+  const currentNotes = notes.filter(note => {
+        return note.session === sessionId;
+    });
 
   return {
     currentSession,
     sessions,
-    notes,
+    notes: currentNotes,
   };
 }