feat(web): add teams page and RBAC navigation/route gating (MS21-UI-005, RBAC-001, RBAC-002)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful

This commit is contained in:
2026-02-28 22:27:34 -06:00
parent e04b46a6b6
commit 45eaaa7010
8 changed files with 748 additions and 213 deletions

View File

@@ -4,7 +4,7 @@
*/
import type { TeamMemberRole } from "@mosaic/shared";
import { apiDelete, apiGet, apiPost } from "./client";
import { apiDelete, apiGet, apiPatch, apiPost } from "./client";
const WORKSPACE_STORAGE_KEY = "mosaic-workspace-id";
@@ -55,6 +55,11 @@ export interface CreateTeamDto {
description?: string;
}
export interface UpdateTeamDto {
name?: string;
description?: string | null;
}
export interface AddTeamMemberDto {
userId: string;
role?: TeamMemberRole;
@@ -80,6 +85,22 @@ export async function createTeam(dto: CreateTeamDto, workspaceId?: string): Prom
);
}
/**
* Update a team in the active workspace.
*/
export async function updateTeam(
teamId: string,
dto: UpdateTeamDto,
workspaceId?: string
): Promise<TeamRecord> {
const resolvedWorkspaceId = resolveWorkspaceId(workspaceId);
return apiPatch<TeamRecord>(
`/api/workspaces/${resolvedWorkspaceId}/teams/${teamId}`,
dto,
resolvedWorkspaceId
);
}
/**
* Fetch team members for a team in the active workspace.
* The current backend route shape is workspace-scoped team membership.