import {
  SELECT_PERMISSIONS_BOUNDARY,
  UNSELECT_PERMISSIONS_BOUNDARY,
  SELECT_PERMISSIONS_USER,
  UNSELECT_PERMISSIONS_USER,
} from '../actions/types';

const INITIAL_STATE = {
  selectedBoundaries: [],
  selectedUsers: [],
};

const Permissions = (state = INITIAL_STATE, action) => {
  switch (action.type) {
    case SELECT_PERMISSIONS_BOUNDARY:
      return {
        ...state,
        selectedBoundaries: action.value,
      };
    case UNSELECT_PERMISSIONS_BOUNDARY:
      return {
        ...state,
        selectedBoundaries: action.value,
      };
    case SELECT_PERMISSIONS_USER:
      return {
        ...state,
        selectedUsers: action.value,
      };
    case UNSELECT_PERMISSIONS_USER:
      return {
        ...state,
        selectedUsers: action.value,
      };
    default:
      return state;
  }
};

export { Permissions };

@@ -122,16 +122,75 @@
 S_USER,%0A
+  LOADING_BOUNDARY_ASSESSMENT,%0A  SET_BOUNDARY_ASSESSMENTS,%0A
 %7D from '
@@ -280,16 +280,63 @@
 rs: %5B%5D,%0A
+  assessments: %7B%7D,%0A  loadingAssessment: false,%0A
 %7D;%0A%0Acons
@@ -883,24 +883,257 @@
 e,%0A      %7D;%0A
+    case LOADING_BOUNDARY_ASSESSMENT:%0A      return %7B%0A        ...state,%0A        loadingAssessment: action.value,%0A      %7D;%0A    case SET_BOUNDARY_ASSESSMENTS:%0A      return %7B%0A        ...state,%0A        assessments: action.value,%0A      %7D;%0A
     default:

add case in permission store to add boundary assessments