blob: 6dc3c682a2fbdfe041302f44348599b984472459 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
import { call, getContext } from 'redux-saga/effects'
import { fetchAndStoreAllTopologiesOfProject } from './topology'
import { fetchPortfoliosOfProject } from './portfolios'
import { fetchProject } from '../../api/projects'
export function* onOpenProjectSucceeded(action) {
try {
const auth = yield getContext('auth')
const queryClient = yield getContext('queryClient')
const project = yield call(() =>
queryClient.fetchQuery(`projects/${action.id}`, () => fetchProject(auth, action.id))
)
yield fetchAndStoreAllTopologiesOfProject(action.id, true)
yield fetchPortfoliosOfProject(project)
} catch (error) {
console.error(error)
}
}
|