feat(workspace): synchronize folders with server and add folder deletion
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 58s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 58s
This commit is contained in:
1 parent
1be0909344
commit
c4b2a00348
5 files changed
+382
-49
No files matched your search
@@ -368,6 +368,26 @@ export const api = {
|
||||
await request(`/api/v1/task-lists/${id}`, { method: 'DELETE' });
|
||||
},
|
||||
|
||||
// --- WORKSPACE FOLDERS ---
|
||||
async getFolders(): Promise<string[]> {
|
||||
const res = await request<string[]>('/api/v1/folders');
|
||||
return ensureArray(res);
|
||||
},
|
||||
|
||||
async createFolder(path: string): Promise<{ path: string }> {
|
||||
return request<{ path: string }>('/api/v1/folders', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ path }),
|
||||
});
|
||||
},
|
||||
|
||||
async deleteFolder(path: string): Promise<{ deleted: boolean; deletedDocIds: string[] }> {
|
||||
return request<{ deleted: boolean; deletedDocIds: string[] }>(
|
||||
`/api/v1/folders?path=${encodeURIComponent(path)}`,
|
||||
{ method: 'DELETE' }
|
||||
);
|
||||
},
|
||||
|
||||
// --- WORKSPACE DOCUMENTS ---
|
||||
async getDocuments(): Promise<Document[]> {
|
||||
const res = await request<Document[]>('/api/v1/documents');
|
||||
|
||||
Reference in new issue
Block a user