sensor list

This commit is contained in:
snoop 2017-08-14 16:58:51 +09:00
parent 65bbc0bb06
commit ee278a6ce3
2 changed files with 14 additions and 9 deletions

View File

@ -12,7 +12,8 @@ import readNoAuthProbeReducer from '@overflow/noauthprobe/redux/reducer/read_all
import readAllTargetByProbeReducer from '@overflow/target/redux/reducer/readAllByProbe'; import readAllTargetByProbeReducer from '@overflow/target/redux/reducer/readAllByProbe';
import readTargetReducer from '@overflow/target/redux/reducer/read'; import readTargetReducer from '@overflow/target/redux/reducer/read';
import readAllByTargetReducer from '@overflow/sensor/redux/reducer/read_all_by_target'; import sensorReadAllByTargetReducer from '@overflow/sensor/redux/reducer/read_all_by_target';
import sensorReadAllByDomainReducer from '@overflow/sensor/redux/reducer/read_all_by_domain';
import SensorReadReducer from '@overflow/sensor/redux/reducer/read'; import SensorReadReducer from '@overflow/sensor/redux/reducer/read';
import SensorItemReadAllBySensorReducer from '@overflow/sensor/redux/reducer/item_read_all_by_sensor'; import SensorItemReadAllBySensorReducer from '@overflow/sensor/redux/reducer/item_read_all_by_sensor';
@ -59,7 +60,8 @@ const reduxConfig: ReduxConfig = {
signInReducer, signInReducer,
readAllProbeReducer, readAllProbeReducer,
readProbeReducer, readProbeReducer,
readAllByTargetReducer, sensorReadAllByTargetReducer,
sensorReadAllByDomainReducer,
SensorReadReducer, SensorReadReducer,
signUpReducer, signUpReducer,
SensorItemReadAllBySensorReducer, SensorItemReadAllBySensorReducer,

View File

@ -1,19 +1,22 @@
import Action from '@overflow/commons/redux/Action'; import Action from '@overflow/commons/redux/Action';
import { ReducersMapObject } from 'redux'; import { ReducersMapObject } from 'redux';
import Target from '@overflow/target/api/model/Target'; import Sensor from '@overflow/sensor/api/model/Sensor';
import * as ReadAllByDomainActionTypes from '../action/read_all_by_domain'; import * as ReadAllByDomainActionTypes from '../action/read_all_by_domain';
import ReadAllByTargetDomain, { defaultState as readAllByDomainDefaultState } from '../state/ReadAllByDomain'; import ReadAllByDomain, { defaultState as readAllByDomainDefaultState } from '../state/ReadAllByDomain';
const reducer: ReducersMapObject = { const reducer: ReducersMapObject = {
[ReadAllByDomainActionTypes.REQUEST_SUCCESS]: [ReadAllByDomainActionTypes.REQUEST_SUCCESS]:
(state: ReadAllByTargetDomain = readAllByDomainDefaultState, action: Action<Target>): (state: ReadAllByDomain = readAllByDomainDefaultState, action: Action<Sensor[]>):
ReadAllByTargetDomain => { ReadAllByDomain => {
return state; return {
...state,
SensorList:<Sensor[]>action.payload,
};
}, },
[ReadAllByDomainActionTypes.REQUEST_FAILURE]: [ReadAllByDomainActionTypes.REQUEST_FAILURE]:
(state: ReadAllByTargetDomain = readAllByDomainDefaultState, action: Action<Error>): (state: ReadAllByDomain = readAllByDomainDefaultState, action: Action<Error>):
ReadAllByTargetDomain => { ReadAllByDomain => {
return state; return state;
}, },
}; };