Skip to content

Commit b5414d8

Browse files
committed
fix: handle item creation and update #1117
1 parent e207b51 commit b5414d8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/views/certificate/CertificateEditor.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ const errors = ref({}) as Ref<Record<string, string>>
4343
4444
async function save() {
4545
try {
46-
const r = await cert.updateItem(data.value.id, data.value)
46+
const r = data.value.id
47+
? await cert.updateItem(data.value.id, data.value)
48+
: await cert.createItem(data.value)
4749
data.value = r
4850
errors.value = {}
4951
message.success($gettext('Save successfully'))

0 commit comments

Comments
 (0)