# src/reducers/releasedInvestigations.js

## Maintainability

62.49

## Lines of code

31

## Difficulty

18.00

## Estimated Errors

0.18

## Function weight

### By Complexity

### By SLOC

import { LOG_OUT, FECTH_RELEASED_INVESTIGATIONS_PENDING, FECTH_RELEASED_INVESTIGATIONS_FULFILLED } from '../constants/ActionTypes' const initialState = {"fetching": false, "fetched": false,"data":[], "error": null} const releasedInvestigations = (state = initialState, action) => { switch (action.type) { case FECTH_RELEASED_INVESTIGATIONS_PENDING: { state = {...state, fetched: false, fetching: true}; break; } case FECTH_RELEASED_INVESTIGATIONS_FULFILLED: { state = {...state, data: action.payload.data.map((object,i ) => object.Investigation), fetched: true, fetching: false} break; } case LOG_OUT: { state = {...state, "fetching": false, "fetched": false, data: []}; break; } default: break; } return state; } export default releasedInvestigations;