Also delete notes when deleting session.
authorAlexandre Segura <mex.zktk@gmail.com>
Tue, 27 Jun 2017 10:54:04 +0200
changeset 96 b58463d7dc8e
parent 95 7bc08467c726
child 97 69eaef18b01b
Also delete notes when deleting session.
client/src/reducers/notesReducer.js
--- a/client/src/reducers/notesReducer.js	Mon Jun 26 18:15:44 2017 +0200
+++ b/client/src/reducers/notesReducer.js	Tue Jun 27 10:54:04 2017 +0200
@@ -26,6 +26,8 @@
         .set('html', action.data.html)
         .set('categories', action.data.categories);
       return state.set(index, newNote);
+    case types.DELETE_SESSION:
+      return state.filter((note) => action.session.get('_id') !== note.session)
     default:
       return state;
   }