diff --git a/backend/controllers/systems.js b/backend/controllers/systems.js index a168ee0..2c775dd 100644 --- a/backend/controllers/systems.js +++ b/backend/controllers/systems.js @@ -33,7 +33,6 @@ exports.get_systems = function (req, res) { lastActive: results[result].lastActive, callAvg: results[result].callAvg, description: results[result].description, - planType: results[result].planType, clientCount: clientCount } if (results[result].showScreenName && results[result].userId) { diff --git a/backend/models/system.js b/backend/models/system.js index c592bc9..980e264 100644 --- a/backend/models/system.js +++ b/backend/models/system.js @@ -16,6 +16,7 @@ var systemSchema = mongoose.Schema({ callCount: Number, ignoreUnknownTalkgroup : Boolean, active: {type: Boolean, default: false}, + lastActive: Date, planType: {type: Number, default: 0}, userId: {type: mongoose.Schema.Types.ObjectId, ref: 'User'}, key: String diff --git a/frontend/src/System/ListSystems.js b/frontend/src/System/ListSystems.js index 3728e7b..5b99cb2 100644 --- a/frontend/src/System/ListSystems.js +++ b/frontend/src/System/ListSystems.js @@ -25,15 +25,16 @@ import InternationList from "./InternationList"; const ListSystems = (props) => { - const { data: allSystems, isSuccess } = useGetSystemsQuery(); - const systems = useSelector(selectActiveSystems) + const { data: systems, isSuccess } = useGetSystemsQuery(); + //const systems = useSelector(selectActiveSystems) const contextRef = useRef(); // Sorts the systems by State and also creates an International Arry let states = {}; let other = [] - for (var i = 0; i < systems.length; i++) { - const system = systems[i]; + if (isSuccess && systems.systems) + for (var i = 0; i < systems.systems.length; i++) { + const system = systems.systems[i]; if (system.hasOwnProperty("state")) { if (!states.hasOwnProperty(system.state)) { states[system.state] = [];