mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-12 16:57:39 -05:00
Systems sorted by State!
This commit is contained in:
@@ -44,20 +44,5 @@ export const apiSlice = createApi({
|
||||
})
|
||||
})
|
||||
|
||||
export const selectSystemsResult = apiSlice.endpoints.getSystems.select();
|
||||
|
||||
const emptySystems = []
|
||||
|
||||
export const selectAllSystems = createSelector(
|
||||
selectSystemsResult,
|
||||
systemsResult => systemsResult?.data ?? emptySystems
|
||||
)
|
||||
|
||||
export const selectActiveSystems = createSelector(
|
||||
selectAllSystems,
|
||||
(state, userId) => userId,
|
||||
(systems, userId) => systems.find(system => system.active === true)
|
||||
)
|
||||
|
||||
// Export the auto-generated hook for the `getPosts` query endpoint
|
||||
export const { useGetGroupsQuery, useGetSystemsQuery, useGetTalkgroupsQuery, useGetEventsQuery, useGetEventQuery, useAddNewEventMutation } = apiSlice
|
||||
|
||||
Reference in New Issue
Block a user