diff options
| author | jc0b <j@jc0b.computer> | 2020-07-07 16:55:22 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:47:51 +0200 |
| commit | 223e916997eb641a1662110b6de630a4cdfdf479 (patch) | |
| tree | 90ca4364461f676db45f25e03d8f22fc32f9fdd8 /frontend/src/sagas/simulations.js | |
| parent | 9ff1e3c6bae253372a468dbdc9b8369ab8dd2c6f (diff) | |
| parent | b810c4413079bf5aeb5374f1cd20e151a83530d0 (diff) | |
Merge branch 'feature/mongodb-migration' of github.com:atlarge-research/opendc-dev into feature/mongodb-migration
Diffstat (limited to 'frontend/src/sagas/simulations.js')
| -rw-r--r-- | frontend/src/sagas/simulations.js | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/frontend/src/sagas/simulations.js b/frontend/src/sagas/simulations.js deleted file mode 100644 index be69fedd..00000000 --- a/frontend/src/sagas/simulations.js +++ /dev/null @@ -1,43 +0,0 @@ -import { call, put } from 'redux-saga/effects' -import { addToStore } from '../actions/objects' -import { addSimulationSucceeded, deleteSimulationSucceeded } from '../actions/simulations' -import { addSimulation, deleteSimulation, getSimulation } from '../api/routes/simulations' -import { fetchAndStoreAllTopologiesOfSimulation } from './topology' - -export function* onOpenSimulationSucceeded(action) { - try { - const simulation = yield call(getSimulation, action.id) - yield put(addToStore('simulation', simulation)) - - yield fetchAndStoreAllTopologiesOfSimulation(action.id) - } catch (error) { - console.error(error) - } -} - -export function* onSimulationAdd(action) { - try { - const simulation = yield call(addSimulation, { name: action.name }) - yield put(addToStore('simulation', simulation)) - - const authorization = { - simulationId: simulation._id, - userId: action.userId, - authorizationLevel: 'OWN', - simulation, - } - yield put(addToStore('authorization', authorization)) - yield put(addSimulationSucceeded([authorization.userId, authorization.simulationId])) - } catch (error) { - console.error(error) - } -} - -export function* onSimulationDelete(action) { - try { - yield call(deleteSimulation, action.id) - yield put(deleteSimulationSucceeded(action.id)) - } catch (error) { - console.error(error) - } -} |
