feat: alert on folder exist
This commit is contained in:
parent
720f8e645a
commit
1ee0520505
1 changed files with 11 additions and 1 deletions
|
|
@ -357,7 +357,17 @@ const useStorage = defineStore('storageStore', () => {
|
|||
|
||||
async function createFolder(name: string, path: string = currentInfo.path) {
|
||||
loader.show()
|
||||
await api.post(constructUrl(path, true), { name })
|
||||
if (
|
||||
folder.value[consistantPath(path)]?.findIndex((v) => v.name === name) !==
|
||||
-1
|
||||
) {
|
||||
error.set({
|
||||
title: 'แจ้งเตือน',
|
||||
msg: `พบชื่อ \"${name}\" ซ้ำในระบบ`,
|
||||
})
|
||||
} else {
|
||||
await api.post(constructUrl(path, true), { name })
|
||||
}
|
||||
loader.hide()
|
||||
}
|
||||
async function editFolder(name: string, path: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue