summaryrefslogtreecommitdiff
path: root/src/reducers/topology.js
blob: f98b50e7bdaa99c75862c415a7371462c9d80d18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import {FETCH_LATEST_DATACENTER_SUCCEEDED, RESET_CURRENT_DATACENTER} from "../actions/topology/building";

export function currentDatacenterId(state = -1, action) {
    switch (action.type) {
        case FETCH_LATEST_DATACENTER_SUCCEEDED:
            return action.datacenterId;
        case RESET_CURRENT_DATACENTER:
            return -1;
        default:
            return state;
    }
}