feat: message edit and reaction

This commit is contained in:
zerosoul
2022-03-08 11:24:02 +08:00
parent 05896932b5
commit c99be639dc
16 changed files with 357 additions and 177 deletions
+6 -3
View File
@@ -1,5 +1,5 @@
import { createApi } from "@reduxjs/toolkit/query/react";
// import BASE_URL from "../config";
import { ContentTypes } from "../config";
import baseQuery from "./base.query";
@@ -8,10 +8,13 @@ export const messageApi = createApi({
baseQuery,
endpoints: (builder) => ({
editMessage: builder.mutation({
query: ({ mid, data }) => ({
query: ({ mid, content, type = "text" }) => ({
headers: {
"content-type": ContentTypes[type],
},
url: `/message/${mid}/edit`,
method: "PUT",
body: data,
body: content,
}),
}),
likeMessage: builder.mutation({