feat: add personal and group view ownership
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
type EffectiveViewProjection
|
||||
} from "@govoplan/core-webui";
|
||||
|
||||
export type ViewScopeType = "system" | "tenant";
|
||||
export type ViewScopeType = "system" | "tenant" | "group" | "user";
|
||||
export type ViewAssignmentScopeType = "system" | "tenant" | "group" | "user";
|
||||
export type ViewAssignmentMode = "available" | "default" | "required";
|
||||
|
||||
@@ -148,12 +148,14 @@ export async function selectEffectiveView(
|
||||
|
||||
export async function fetchViewDefinitions(
|
||||
settings: ApiSettings,
|
||||
scopeType: ViewScopeType
|
||||
scopeType: ViewScopeType,
|
||||
scopeId?: string | null
|
||||
): Promise<ViewDefinition[]> {
|
||||
const response = await apiFetch<{ definitions: ViewDefinition[] }>(
|
||||
settings,
|
||||
apiPath("/api/v1/views/definitions", {
|
||||
scope_type: scopeType,
|
||||
scope_id: scopeId || undefined,
|
||||
include_inherited: scopeType === "tenant"
|
||||
})
|
||||
);
|
||||
@@ -164,6 +166,7 @@ export function createViewDefinition(
|
||||
settings: ApiSettings,
|
||||
payload: {
|
||||
scope_type: ViewScopeType;
|
||||
scope_id?: string | null;
|
||||
name: string;
|
||||
description?: string | null;
|
||||
visible_surface_ids: string[];
|
||||
|
||||
Reference in New Issue
Block a user