summaryrefslogtreecommitdiff
path: root/src/sagas/topology.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/sagas/topology.js')
-rw-r--r--src/sagas/topology.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sagas/topology.js b/src/sagas/topology.js
index f507b2ad..b128ff97 100644
--- a/src/sagas/topology.js
+++ b/src/sagas/topology.js
@@ -22,6 +22,10 @@ import {
updateRackOnTile
} from "../api/routes/tiles";
import {
+ fetchAndStoreAllCPUs,
+ fetchAndStoreAllGPUs,
+ fetchAndStoreAllMemories,
+ fetchAndStoreAllStorages,
fetchAndStoreCoolingItem,
fetchAndStoreCPU,
fetchAndStoreDatacenter,
@@ -43,6 +47,7 @@ export function* onFetchLatestDatacenter(action) {
const latestPath = paths[paths.length - 1];
const sections = yield fetchAndStoreSectionsOfPath(latestPath.id);
const latestSection = sections[sections.length - 1];
+ yield fetchAllUnitSpecifications();
yield fetchDatacenter(latestSection.datacenterId);
yield put(fetchLatestDatacenterSucceeded(latestSection.datacenterId));
} catch (error) {
@@ -64,6 +69,17 @@ export function* fetchDatacenter(datacenterId) {
}
}
+function* fetchAllUnitSpecifications() {
+ try {
+ yield fetchAndStoreAllCPUs();
+ yield fetchAndStoreAllGPUs();
+ yield fetchAndStoreAllMemories();
+ yield fetchAndStoreAllStorages();
+ } catch (error) {
+ console.log(error);
+ }
+}
+
function* fetchRoom(roomId) {
const tiles = yield fetchAndStoreTilesOfRoom(roomId);
yield put(addPropToStoreObject("room", roomId, {tileIds: tiles.map(tile => tile.id)}));