Commit 79affc16 authored by Alejandro De Maria Antolinos's avatar Alejandro De Maria Antolinos

Merge branch 'issue_180' into 'master'

It fixes #180

Closes #180

See merge request !163
parents 12efc756 f6b05603
Pipeline #12577 passed with stages
in 5 minutes and 38 seconds
import {
LOG_OUT,
FETCH_INSTRUMENT_SCIENTIST_INVESTIGATIONS_FULFILLED,
FETCH_INSTRUMENT_SCIENTIST_INVESTIGATIONS_PENDING
} from '../constants/ActionTypes'
const initialState = {"fetching": false, "fetched": false,"data":[], "error": null}
const scientistInstrumentInvestigations = (state = initialState, action) => {
switch (action.type) {
case FETCH_INSTRUMENT_SCIENTIST_INVESTIGATIONS_PENDING: {
state = {...state, fetched: false, fetching: true};
break;
}
case FETCH_INSTRUMENT_SCIENTIST_INVESTIGATIONS_FULFILLED: {
debugger
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 scientistInstrumentInvestigations;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment