feat(tasks): enable sharing task lists with teams and users
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m6s

This commit is contained in:
sandrodach committed 2026-10-25 13:00:17 +01:00
1 parent cfc0477b5c
commit 0afa2f9c2d
7 files changed
+686 -173

No files matched your search

+27 -1
View File
@@ -15,6 +15,7 @@ import {
SystemSettings,
Team,
TaskList,
TaskListShare,
Thought,
SubTask,
TagDetails,
@@ -336,13 +337,18 @@ export const api = {
// --- TASK LISTS ---
async getTaskLists(): Promise<TaskList[]> {
const res = await request<TaskList[]>('/api/v1/task-lists');
return ensureArray(res);
return ensureArray(res).map((tl) => ({
...tl,
members: ensureArray(tl.members),
shares: ensureArray(tl.shares),
}));
},
async createTaskList(payload: {
title: string;
icon?: string;
color?: string;
teamId?: string;
spaceId?: string;
}): Promise<TaskList> {
return request<TaskList>('/api/v1/task-lists', {
@@ -357,6 +363,7 @@ export const api = {
title?: string;
icon?: string;
color?: string;
teamId?: string;
spaceId?: string;
}
): Promise<TaskList> {
@@ -370,6 +377,25 @@ export const api = {
await request(`/api/v1/task-lists/${id}`, { method: 'DELETE' });
},
async getTaskListShares(id: string): Promise<TaskListShare[]> {
const res = await request<TaskListShare[]>(`/api/v1/task-lists/${id}/shares`);
return ensureArray(res);
},
async addTaskListShare(
id: string,
payload: { targetType: 'team' | 'user'; targetId: string }
): Promise<TaskListShare> {
return request<TaskListShare>(`/api/v1/task-lists/${id}/shares`, {
method: 'POST',
body: JSON.stringify(payload),
});
},
async removeTaskListShare(id: string, shareId: string): Promise<void> {
await request(`/api/v1/task-lists/${id}/shares/${shareId}`, { method: 'DELETE' });
},
// --- WORKSPACE FOLDERS ---
async getFolders(): Promise<string[]> {
const res = await request<string[]>('/api/v1/folders');