updated
This commit is contained in:
@@ -19,7 +19,7 @@ import {
|
|||||||
} from "@chakra-ui/react"
|
} from "@chakra-ui/react"
|
||||||
|
|
||||||
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
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 { type ApiError, type AboutUsCreate, AboutUsService } from "../../client"
|
||||||
import useCustomToast from "../../hooks/useCustomToast"
|
import useCustomToast from "../../hooks/useCustomToast"
|
||||||
import { handleError } from "../../utils"
|
import { handleError } from "../../utils"
|
||||||
|
@@ -101,7 +101,7 @@ const EditAboutUs = ({ aboutUs, isOpen, onClose }: EditAboutUsProps) => {
|
|||||||
}
|
}
|
||||||
return EditorState.createEmpty();
|
return EditorState.createEmpty();
|
||||||
});
|
});
|
||||||
const [content, setContent] = useState<string>(aboutUs.description);
|
// const [content, setContent] = useState<string>(aboutUs.description);
|
||||||
|
|
||||||
// const validateFiles = (value: File) => {
|
// const validateFiles = (value: File) => {
|
||||||
// if (typeof value === 'string') return true;
|
// if (typeof value === 'string') return true;
|
||||||
@@ -189,7 +189,7 @@ const EditAboutUs = ({ aboutUs, isOpen, onClose }: EditAboutUsProps) => {
|
|||||||
onEditorStateChange={newState => {
|
onEditorStateChange={newState => {
|
||||||
setEditorState(newState);
|
setEditorState(newState);
|
||||||
const newContent = draftToHtml(convertToRaw(newState.getCurrentContent()));
|
const newContent = draftToHtml(convertToRaw(newState.getCurrentContent()));
|
||||||
setContent(newContent);
|
//setContent(newContent);
|
||||||
reset({
|
reset({
|
||||||
description: newContent,
|
description: newContent,
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user