diff --git a/web/src/api/client.ts b/web/src/api/client.ts index 1e7351ff..56011165 100644 --- a/web/src/api/client.ts +++ b/web/src/api/client.ts @@ -40,6 +40,7 @@ import type { AdminLabelInput, LabelDefinition, LabelItem, + BatchMemberResponse, } from './types' import { ApiError } from '@/shared/lib/api-error' import i18n from '@/i18n/config' @@ -702,6 +703,16 @@ export const namespaceApi = { }) }, + async batchAddMembers(slug: string, members: Array<{ userId: string; role: string }>): Promise { + return fetchJson(`${WEB_API_PREFIX}/namespaces/${normalizeNamespaceSlug(slug)}/members/batch`, { + method: 'POST', + headers: await ensureCsrfHeaders({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify({ members }), + }) + }, + async updateMemberRole(slug: string, userId: string, role: string): Promise { return fetchJson( `${WEB_API_PREFIX}/namespaces/${normalizeNamespaceSlug(slug)}/members/${encodeURIComponent(userId)}/role`,