[release-2.0] fix: cannot save post when the publishTime is blank (#764)

This is an automated cherry-pick of #763

/assign JohnNiang

```release-note
修复 Console 端文章设置中的发布时间为空字符串时,无法保存的问题。
```
pull/776/head
Halo Dev Bot 2022-12-12 14:40:22 +08:00 committed by GitHub
parent caca4975c7
commit a3caa29efa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -177,7 +177,7 @@ const publishTime = computed(() => {
});
const onPublishTimeChange = (value: string) => {
formState.value.spec.publishTime = toISOString(value);
formState.value.spec.publishTime = value ? toISOString(value) : undefined;
};
</script>

View File

@ -169,7 +169,7 @@ const publishTime = computed(() => {
});
const onPublishTimeChange = (value: string) => {
formState.value.spec.publishTime = toISOString(value);
formState.value.spec.publishTime = value ? toISOString(value) : undefined;
};
</script>
<template>