From b5ac7d3ee49f2e4e5b8cafbe2f3e9c34fe9b0403 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Sat, 21 Mar 2026 18:29:16 +0100 Subject: [PATCH] feat: add category override API client methods --- packages/web/src/api/client.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/web/src/api/client.ts b/packages/web/src/api/client.ts index ce3f8b0a..2edc66de 100644 --- a/packages/web/src/api/client.ts +++ b/packages/web/src/api/client.ts @@ -116,6 +116,9 @@ export class BackspaceApiClient { create: (spaceId: string, name: string) => Promise; update: (id: string, data: { name?: string; position?: number }) => Promise; delete: (id: string) => Promise<{ success: boolean }>; + getOverrides: (categoryId: string) => Promise<{ categoryId: string; targetType: string; targetId: string; allow: string; deny: string }[]>; + putOverride: (categoryId: string, data: { targetType: string; targetId: string; allow: string; deny: string }) => Promise<{ success: boolean }>; + deleteOverride: (categoryId: string, targetType: string, targetId: string) => Promise<{ success: boolean }>; }; readonly messages: { @@ -406,6 +409,14 @@ export class BackspaceApiClient { request('PATCH', `/categories/${id}`, data), delete: (id: string) => request<{ success: boolean }>('DELETE', `/categories/${id}`), + getOverrides: (categoryId: string) => + request<{ categoryId: string; targetType: string; targetId: string; allow: string; deny: string }[]>( + 'GET', `/categories/${categoryId}/overrides` + ), + putOverride: (categoryId: string, data: { targetType: string; targetId: string; allow: string; deny: string }) => + request<{ success: boolean }>('PUT', `/categories/${categoryId}/overrides`, data), + deleteOverride: (categoryId: string, targetType: string, targetId: string) => + request<{ success: boolean }>('DELETE', `/categories/${categoryId}/overrides/${targetType}/${targetId}`), }; this.messages = {