refactor: more TS code
This commit is contained in:
@@ -126,13 +126,13 @@ export const authApi = createApi({
|
||||
}),
|
||||
sendRegMagicLink: builder.mutation<
|
||||
{
|
||||
new_magic_token: "string";
|
||||
new_magic_token: string;
|
||||
mail_is_sent: boolean;
|
||||
},
|
||||
{
|
||||
magic_token: "string";
|
||||
email: "string";
|
||||
password: "string";
|
||||
magic_token: string;
|
||||
email: string;
|
||||
password: string;
|
||||
}
|
||||
>({
|
||||
query: (data) => ({
|
||||
|
||||
@@ -121,7 +121,7 @@ export const serverApi = createApi({
|
||||
getLoginConfig: builder.query<LoginConfig, void>({
|
||||
query: () => ({ url: `admin/login/config` })
|
||||
}),
|
||||
updateLoginConfig: builder.mutation<void, LoginConfig>({
|
||||
updateLoginConfig: builder.mutation<void, Partial<LoginConfig>>({
|
||||
query: (data) => ({
|
||||
url: `admin/login/config`,
|
||||
method: "POST",
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
import BASE_URL, { ContentTypes } from "../config";
|
||||
import { isImage } from "../../common/utils";
|
||||
import { ContentType } from "../../types/message";
|
||||
export interface MessagePayload {
|
||||
mid: number;
|
||||
from_uid?: number;
|
||||
read?: boolean;
|
||||
created_at?: number;
|
||||
sending: boolean;
|
||||
content_type: string;
|
||||
content_type: ContentType;
|
||||
content: string;
|
||||
expires_in?: number | null;
|
||||
properties?: {
|
||||
content_type: string;
|
||||
size: number;
|
||||
@@ -13,6 +18,8 @@ export interface MessagePayload {
|
||||
file_path?: string;
|
||||
download?: string;
|
||||
thumbnail?: string;
|
||||
edited?: boolean | number;
|
||||
reply_mid?: number;
|
||||
}
|
||||
export interface State {
|
||||
[key: number]: MessagePayload;
|
||||
|
||||
@@ -8,7 +8,14 @@ export interface State {
|
||||
menuExpand: boolean;
|
||||
// todo
|
||||
fileListView: string;
|
||||
uploadFiles: { [key: string]: any };
|
||||
uploadFiles: {
|
||||
[key: string]: {
|
||||
name: string;
|
||||
url: string;
|
||||
size: number;
|
||||
type: string;
|
||||
}[];
|
||||
};
|
||||
selectMessages: { [key: string]: any };
|
||||
draftMarkdown: { [key: string]: any };
|
||||
draftMixedText: { [key: string]: any };
|
||||
|
||||
Reference in New Issue
Block a user