client/src/components/Session.js
changeset 58 f16a080e0bc4
parent 46 4aa24724e5b3
child 59 1eb52770eefa
--- a/client/src/components/Session.js	Mon Jun 19 18:32:27 2017 +0200
+++ b/client/src/components/Session.js	Mon Jun 19 21:37:33 2017 +0200
@@ -13,7 +13,7 @@
 class Session extends Component {
 
   componentDidMount = () => {
-    this.props.notesActions.loadNotesBySession({ _id: this.props.match.params.id });
+    //this.props.notesActions.loadNotesBySession({ _id: this.props.match.params.id });
   }
 
   render() {
@@ -50,14 +50,20 @@
 
   const sessionId = props.match.params.id;
 
-  const sessions = state.get('sessions');
-  const notes = state.get('notes');
+//   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,
   };
 }