refactor: useInviteLink

This commit is contained in:
Tristan Yang
2022-06-17 22:18:54 +08:00
parent 9a9fd75e0a
commit b25907f7fc
4 changed files with 16 additions and 22 deletions
+4 -2
View File
@@ -71,12 +71,14 @@ export const channelApi = createApi({
}
}),
createInviteLink: builder.query({
query: (gid) => ({
query: (gid = "") => ({
headers: {
"content-type": "text/plain",
accept: "text/plain"
},
url: `/group/${gid}/create_invite_link`,
url: gid
? `/group/create_reg_magic_link?expired_in=3600&max_times=1&gid=${gid}`
: `/group/create_reg_magic_link?expired_in=3600&max_times=1`,
responseHandler: (response) => response.text()
}),
transformResponse: (link) => {