chapter update fix
This commit is contained in:
parent
2ac082a4e4
commit
e10b43bddb
1 changed files with 8 additions and 1 deletions
|
|
@ -38,7 +38,14 @@ export function BookChapterForm({
|
|||
readonly initialValues?: BookChapterEditInitialValues | null;
|
||||
readonly onChapterSubmit: (chapter: BookChapterInput) => Promise<void>;
|
||||
}) {
|
||||
const [content, setContent] = useState<Descendant[]>([]);
|
||||
const [content, setContent] = useState<Descendant[]>(
|
||||
initialValues?.content ?? [
|
||||
{
|
||||
type: 'paragraph',
|
||||
children: [{ text: '' }]
|
||||
}
|
||||
]
|
||||
);
|
||||
|
||||
const schema = v.pipe(
|
||||
v.object({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue