feat: lots of updates

This commit is contained in:
zerosoul
2022-02-10 23:35:25 +08:00
parent e8b6c2b0f1
commit d05c5ff8f2
33 changed files with 1072 additions and 331 deletions
+8 -3
View File
@@ -1,6 +1,8 @@
import { createApi } from "@reduxjs/toolkit/query/react";
import baseQuery from "./base.query";
import { REHYDRATE } from "redux-persist";
import { ContentTypes } from "../config";
export const channelApi = createApi({
reducerPath: "channel",
baseQuery,
@@ -22,10 +24,13 @@ export const channelApi = createApi({
}),
}),
sendChannelMsg: builder.mutation({
query: ({ gid, message }) => ({
url: `group/${gid}/send`,
query: ({ id, content, type = "text" }) => ({
headers: {
"content-type": ContentTypes[type],
},
url: `group/${id}/send`,
method: "POST",
body: message,
body: content,
}),
}),
}),