github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/build-blockchain-insurance-app-master/web/src/police/reducers/policeReducer.js (about)

     1  'use strict';
     2  
     3  import * as PoliceActionType from '../actions/policeActionTypes';
     4  import * as initialState from './initialState';
     5  
     6  export default function policeReducer(state = initialState.police, action) {
     7    switch (action.type) {
     8      case PoliceActionType.LOAD_THEFT_CLAIMS_SUCCESS:
     9        return Object.assign({}, state, { theftClaims: action.theftClaims });
    10      case PoliceActionType.PROCESS_THEFT_CLAIM_SUCCESS:
    11        return Object.assign({}, state,
    12          {
    13            theftClaims: [
    14              ...(state.theftClaims.filter(tc => tc.uuid !== action.uuid))
    15            ]
    16          });
    17      default:
    18        return state;
    19    }
    20  }