Add support for sending messages

This commit is contained in:
Luke Berndt
2023-06-25 09:59:48 -04:00
parent 72798e4494
commit 3a7ec72aab
14 changed files with 269 additions and 19 deletions

View File

@@ -54,10 +54,19 @@ export const apiSlice = createApi({
method: 'POST',
body: initialEvent
})
}),
contactSystem: builder.mutation({
query: (args) => {
const {shortName, body} = args;
return {
url: `/${shortName}/contact`,
method: 'POST',
body: body
}}
})
})
})
// Export the auto-generated hook for the `getPosts` query endpoint
export const { useGetGroupsQuery, useGetSystemsQuery, useGetTalkgroupsQuery, useGetStatsQuery, useGetEventsQuery, useGetEventQuery, useAddNewEventMutation } = apiSlice
export const { useGetGroupsQuery, useGetSystemsQuery, useGetTalkgroupsQuery, useGetStatsQuery, useGetEventsQuery, useGetEventQuery, useAddNewEventMutation, useContactSystemMutation } = apiSlice