refactor: setting page

This commit is contained in:
zerosoul
2022-04-15 13:18:03 +08:00
parent eb8717da8e
commit 19a4861819
9 changed files with 56 additions and 63 deletions
+17
View File
@@ -72,6 +72,21 @@ export const channelApi = createApi({
// }
// },
}),
createInviteLink: builder.query({
query: (gid) => ({
headers: {
"content-type": "text/plain",
accept: "text/plain",
},
url: `/group/${gid}/create_invite_link`,
responseHandler: (response) => response.text(),
}),
transformResponse: (link) => {
// 替换掉域名
const invite = new URL(link);
return `${location.origin}${invite.pathname}${invite.search}${invite.hash}`;
},
}),
removeChannel: builder.query({
query: (id) => ({
url: `group/${id}`,
@@ -126,6 +141,8 @@ export const channelApi = createApi({
});
export const {
useLazyCreateInviteLinkQuery,
useCreateInviteLinkQuery,
useLazyGetHistoryMessagesQuery,
useGetChannelQuery,
useUpdateChannelMutation,