( pageId: string, targetFolderId: string | undefined )
| 177 | |
| 178 | // 检查页面在目标文件夹是否重名 |
| 179 | export function checkPageNameConflict( |
| 180 | pageId: string, |
| 181 | targetFolderId: string | undefined |
| 182 | ): string | null { |
| 183 | const { page } = stores |
| 184 | const movingPage = page.getById(pageId) |
| 185 | if (!movingPage) return null |
| 186 | |
| 187 | const siblingPages = page.findByFolderId(targetFolderId) |
| 188 | const conflict = siblingPages.find((p) => p.id !== pageId && p.name === movingPage.name) |
| 189 | return conflict ? movingPage.name : null |
| 190 | } |
| 191 | |
| 192 | // 检查文件夹在目标文件夹是否重名 |
| 193 | export function checkFolderNameConflict( |
nothing calls this directly
no test coverage detected