Sfoglia il codice sorgente

Fixed unique validation for empty page

Taichi Masuyama 4 anni fa
parent
commit
40dedfab8c
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      packages/app/src/server/models/obsolete-page.js

+ 1 - 1
packages/app/src/server/models/obsolete-page.js

@@ -929,7 +929,7 @@ export const getPageSchema = (crowi) => {
       grant = GRANT_PUBLIC;
     }
 
-    const isExist = await this.count({ path });
+    const isExist = await this.count({ path, isEmpty: false }); // not validate empty page
     if (isExist) {
       throw new Error('Cannot create new page to existed path');
     }