fix: error on edit without fie
This commit is contained in:
parent
6834bba888
commit
2e81aeb402
1 changed files with 3 additions and 3 deletions
|
|
@ -130,7 +130,7 @@ const currentParam = ref<Parameters<typeof submitFileForm>[0]>()
|
|||
async function submitFileForm(
|
||||
value: {
|
||||
mode: 'create' | 'edit'
|
||||
file: File
|
||||
file?: File
|
||||
title: string
|
||||
description: string
|
||||
keyword: string
|
||||
|
|
@ -140,12 +140,12 @@ async function submitFileForm(
|
|||
) {
|
||||
currentParam.value = value
|
||||
|
||||
if (checkFile(value.file.name) && !force) {
|
||||
if (value.file && checkFile(value.file.name) && !force) {
|
||||
fileExistNotification.value = true
|
||||
return
|
||||
}
|
||||
|
||||
if (value.mode === 'create') {
|
||||
if (value.mode === 'create' && value.file) {
|
||||
await uploadFile(currentPath.value, value.file, {
|
||||
title: value.title,
|
||||
description: value.description,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue