fix: correct link creation event emission

Differentiates between 'edit' and 'create' events in link editor.
Updates the emit event to properly handle new link creation scenarios.
This commit is contained in:
ccbikai 2025-02-08 20:22:21 +08:00
parent dbba560750
commit 16ca5a1f06

View file

@ -114,7 +114,7 @@ async function onSubmit(formData) {
body: link,
})
dialogOpen.value = false
emit('update:link', newLink, 'edit')
emit('update:link', newLink, isEdit ? 'edit' : 'create')
if (isEdit) {
toast('Link updated successfully')
}