fix: resolve API inconsistencies found by Mokoto

- Bug 1: No fix needed - frontend already uses PUT for document updates
- Bug 2: Changed folders API to use 'project' param (matches documents)
- Bug 3: GET /folders now works without project filter (lists all folders)

Changes:
- folders.js: Accept 'project' instead of 'projectId', make it optional
- folderService.js: Support listing all folders when projectId is null
- api.js: Updated getFolders() to use 'project' param consistently
This commit is contained in:
Hiro
2026-03-28 17:36:58 +00:00
parent 007c51a98f
commit 2d91e17c3e
3 changed files with 46 additions and 16 deletions

View File

@@ -171,10 +171,12 @@ class ApiClient {
}
// ===== Folders =====
getFolders(projectId, parentId = null) {
const params = new URLSearchParams({ projectId });
getFolders(project = null, parentId = null) {
const params = new URLSearchParams();
if (project) params.append('project', project);
if (parentId) params.append('parentId', parentId);
return this.get(`/folders?${params.toString()}`);
const query = params.toString();
return this.get(`/folders${query ? '?' + query : ''}`);
}
getFolder(id) {