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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user