fix: reset form body on draft save

This commit is contained in:
MTG2000
2022-07-13 16:46:58 +03:00
parent a0e13327a6
commit 7fa8d997b3

View File

@@ -62,6 +62,7 @@ export default function StoryForm(props: Props) {
navigate(createRoute({ type: 'story', id: data.createStory?.id!, title: data.createStory?.title }))
else
reset()
props.onSuccess?.(!!data.createStory?.is_published);
setLoading(false)
},
onError: (error) => {
@@ -140,12 +141,7 @@ export default function StoryForm(props: Props) {
</div>
<ContentEditor
key={postId}
initialContent={() => {
console.log('GET');
console.log(getValues().body);
return getValues().body
}}
initialContent={() => getValues().body}
placeholder="Write your story content here..."
name="body"
/>