feat: change channel visibility

This commit is contained in:
Tristan Yang
2022-10-31 17:13:47 +08:00
parent 4950a0663c
commit f89f89eb46
3 changed files with 31 additions and 0 deletions
+8
View File
@@ -42,6 +42,13 @@ export const channelApi = createApi({
body: data
})
}),
changeChannelType: builder.mutation<number, { is_public: boolean, id: number }>({
query: ({ id, is_public }) => ({
url: `group/${id}/change_type`,
method: "POST",
body: { is_public }
})
}),
updateChannel: builder.mutation<void, ChannelDTO>({
query: ({ id, ...data }) => ({
url: `group/${id}`,
@@ -186,6 +193,7 @@ export const channelApi = createApi({
});
export const {
useChangeChannelTypeMutation,
useLazyLeaveChannelQuery,
useLazyCreateInviteLinkQuery,
useCreateInviteLinkQuery,