[release-2.2] fix: the rawType of Content was not updated when switching editors (#909)

This is an automated cherry-pick of #904

/assign JohnNiang

```release-note
修复在新建文章时,首次切换编辑器后没有设置内容 rawType 资源为对应编辑器类型的问题。
```
release-2.2
Halo Dev Bot 2023-03-15 12:00:29 +08:00 committed by GitHub
parent d7d20ec2d8
commit e8b98d4277
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -48,6 +48,7 @@ const handleChangeEditorProvider = (provider: EditorProvider) => {
formState.value.page.metadata.annotations = {
"content.halo.run/preferred-editor": provider.name,
};
formState.value.content.rawType = provider.rawType;
};
// SinglePage form

View File

@ -48,6 +48,7 @@ const handleChangeEditorProvider = (provider: EditorProvider) => {
formState.value.post.metadata.annotations = {
"content.halo.run/preferred-editor": provider.name,
};
formState.value.content.rawType = provider.rawType;
};
// Post form