diff --git a/Services/client/src/stores/storage.ts b/Services/client/src/stores/storage.ts index 9e1367c..3059a98 100644 --- a/Services/client/src/stores/storage.ts +++ b/Services/client/src/stores/storage.ts @@ -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) {