client/src/reducers/notesReducer.js
changeset 29 4cfeabef7d5e
parent 12 48ddaa42b810
child 58 f16a080e0bc4
--- a/client/src/reducers/notesReducer.js	Mon Jun 12 18:09:13 2017 +0200
+++ b/client/src/reducers/notesReducer.js	Mon Jun 12 18:12:38 2017 +0200
@@ -1,19 +1,13 @@
 import Immutable from 'immutable';
-// import PouchDB from 'pouchdb';
-
 import * as types from '../constants/actionTypes';
 import noteRecord from '../store/noteRecord';
 
-// const db = new PouchDB('notes');
-
-// db.allDocs({ include_docs: true, descending: true }, function(err, doc) {
-//   console.log(doc.rows)
-// });
-
 export default (state = Immutable.List([]), action) => {
   switch (action.type) {
     case types.ADD_NOTE:
       return state.push(new noteRecord(action.note));
+    case types.LOAD_NOTES_BY_SESSION:
+      return action.notes;
     default:
       return state;
   }