[release-2.0] fix: the issue that custom link type menu items cannot be saved normally (#751)

This is an automated cherry-pick of #743

/assign JohnNiang

```release-note
修复 Console 端无法正常创建自定义链接类型菜单项的问题。
```
pull/752/head
Halo Dev Bot 2 years ago committed by GitHub
parent 40765be2e2
commit 22685fc298
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -60,11 +60,13 @@ const handleSaveMenuItem = async () => {
(ref) => ref.ref?.kind === selectedRefKind.value (ref) => ref.ref?.kind === selectedRefKind.value
); );
if (menuItemRef) { if (menuItemRef?.ref) {
formState.value.spec.targetRef = { formState.value.spec.targetRef = {
...menuItemRef.ref, ...menuItemRef.ref,
name: selectedRefName.value, name: selectedRefName.value,
}; };
formState.value.spec.displayName = undefined;
formState.value.spec.href = undefined;
} }
if (isUpdateMode.value) { if (isUpdateMode.value) {

Loading…
Cancel
Save