diff options
Diffstat (limited to 'src/sagas/experiments.js')
| -rw-r--r-- | src/sagas/experiments.js | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/src/sagas/experiments.js b/src/sagas/experiments.js index 0ac919f4..2c5395e8 100644 --- a/src/sagas/experiments.js +++ b/src/sagas/experiments.js @@ -2,13 +2,7 @@ import {call, put, select} from "redux-saga/effects"; import {addPropToStoreObject, addToStore} from "../actions/objects"; import {deleteExperiment} from "../api/routes/experiments"; import {addExperiment, getExperimentsOfSimulation} from "../api/routes/simulations"; -import { - fetchAndStoreAllJobs, - fetchAndStoreAllSchedulers, - fetchAndStoreAllTasks, - fetchAndStoreAllTraces, - fetchAndStorePathsOfSimulation -} from "./objects"; +import {fetchAndStoreAllSchedulers, fetchAndStoreAllTraces, fetchAndStorePathsOfSimulation} from "./objects"; export function* onFetchExperimentsOfSimulation() { try { @@ -22,21 +16,18 @@ export function* onFetchExperimentsOfSimulation() { yield put(addPropToStoreObject("simulation", currentSimulationId, {experimentIds: experiments.map(experiment => experiment.id)})); } catch (error) { - console.log(error); + console.error(error); } } function* fetchExperimentSpecifications() { try { const currentSimulationId = yield select(state => state.currentSimulationId); - yield fetchAndStorePathsOfSimulation(currentSimulationId); - yield fetchAndStoreAllTasks(); - yield fetchAndStoreAllJobs(); yield fetchAndStoreAllTraces(); yield fetchAndStoreAllSchedulers(); } catch (error) { - console.log(error); + console.error(error); } } @@ -44,17 +35,20 @@ export function* onAddExperiment(action) { try { const currentSimulationId = yield select(state => state.currentSimulationId); - const experiment = yield call(addExperiment, currentSimulationId, Object.assign({}, action.experiment, { - id: -1, - simulationId: currentSimulationId - })); + const experiment = yield call(addExperiment, + currentSimulationId, + Object.assign({}, action.experiment, { + id: -1, + simulationId: currentSimulationId + }) + ); yield put(addToStore("experiment", experiment)); - const experimentIds = yield select(state => state.objects.simulation[currentSimulationId]); + const experimentIds = (yield select(state => state.objects.simulation[currentSimulationId])).experimentIds; yield put(addPropToStoreObject("simulation", currentSimulationId, {experimentIds: experimentIds.concat([experiment.id])})); } catch (error) { - console.log(error); + console.error(error); } } @@ -68,6 +62,6 @@ export function* onDeleteExperiment(action) { yield put(addPropToStoreObject("simulation", currentSimulationId, {experimentIds: experimentIds.filter(id => id !== action.id)})); } catch (error) { - console.log(error); + console.error(error); } } |
