Events is functional!!!

Just need to clean some things up and test
This commit is contained in:
Luke Berndt
2023-01-22 21:56:53 -05:00
parent 1ab774ec8f
commit b23734c4a3
14 changed files with 506 additions and 29 deletions

View File

@@ -21,6 +21,14 @@ export const apiSlice = createApi({
// The URL for the request is '/fakeApi/posts'
query: () => ({ url: '/systems' })
}),
getEvents: builder.query({
// The URL for the request is '/fakeApi/posts'
query: () => ({ url: '/events' })
}),
getEvent: builder.query({
// The URL for the request is '/fakeApi/posts'
query: (eventId) => ({ url: `/events/${eventId}` })
}),
getTalkgroups: builder.query({
// The URL for the request is '/fakeApi/posts'
query: (shortName) => ({ url: `/${shortName}/talkgroups` })
@@ -52,4 +60,4 @@ export const selectActiveSystems = createSelector(
)
// Export the auto-generated hook for the `getPosts` query endpoint
export const { useGetGroupsQuery, useGetSystemsQuery, useGetTalkgroupsQuery, useAddNewEventMutation } = apiSlice
export const { useGetGroupsQuery, useGetSystemsQuery, useGetTalkgroupsQuery, useGetEventsQuery, useGetEventQuery, useAddNewEventMutation } = apiSlice