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(
|
async function submitFileForm(
|
||||||
value: {
|
value: {
|
||||||
mode: 'create' | 'edit'
|
mode: 'create' | 'edit'
|
||||||
file: File
|
file?: File
|
||||||
title: string
|
title: string
|
||||||
description: string
|
description: string
|
||||||
keyword: string
|
keyword: string
|
||||||
|
|
@ -140,12 +140,12 @@ async function submitFileForm(
|
||||||
) {
|
) {
|
||||||
currentParam.value = value
|
currentParam.value = value
|
||||||
|
|
||||||
if (checkFile(value.file.name) && !force) {
|
if (value.file && checkFile(value.file.name) && !force) {
|
||||||
fileExistNotification.value = true
|
fileExistNotification.value = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value.mode === 'create') {
|
if (value.mode === 'create' && value.file) {
|
||||||
await uploadFile(currentPath.value, value.file, {
|
await uploadFile(currentPath.value, value.file, {
|
||||||
title: value.title,
|
title: value.title,
|
||||||
description: value.description,
|
description: value.description,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue