This commit is contained in:
Philip Cheung 2024-10-07 12:57:56 +08:00
parent 60ac644fc0
commit 011df68509
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ import {
} from "@chakra-ui/react"
import { useMutation, useQueryClient } from "@tanstack/react-query"
import { type SubmitHandler, useForm, UseFormRegisterReturn } from "react-hook-form"
import { type SubmitHandler, useForm } from "react-hook-form"
import { type ApiError, type AboutUsCreate, AboutUsService } from "../../client"
import useCustomToast from "../../hooks/useCustomToast"
import { handleError } from "../../utils"

View File

@ -101,7 +101,7 @@ const EditAboutUs = ({ aboutUs, isOpen, onClose }: EditAboutUsProps) => {
}
return EditorState.createEmpty();
});
const [content, setContent] = useState<string>(aboutUs.description);
// const [content, setContent] = useState<string>(aboutUs.description);
// const validateFiles = (value: File) => {
// if (typeof value === 'string') return true;
@ -189,7 +189,7 @@ const EditAboutUs = ({ aboutUs, isOpen, onClose }: EditAboutUsProps) => {
onEditorStateChange={newState => {
setEditorState(newState);
const newContent = draftToHtml(convertToRaw(newState.getCurrentContent()));
setContent(newContent);
//setContent(newContent);
reset({
description: newContent,
});