feat(search): add global titlebar search filters
This commit is contained in:
@@ -43,6 +43,26 @@ export type SearchResponse = {
|
||||
has_more: boolean;
|
||||
};
|
||||
|
||||
export type SearchProvider = {
|
||||
id: string;
|
||||
module_id: string;
|
||||
resource_types: string[];
|
||||
order: number;
|
||||
};
|
||||
|
||||
export type SearchResourceType = {
|
||||
provider_id: string;
|
||||
module_id: string;
|
||||
resource_type: string;
|
||||
label: string;
|
||||
order: number;
|
||||
};
|
||||
|
||||
export type SearchProviderListResponse = {
|
||||
providers: SearchProvider[];
|
||||
resources: SearchResourceType[];
|
||||
};
|
||||
|
||||
export type SearchRequest = {
|
||||
query: string;
|
||||
modules?: string[];
|
||||
@@ -76,3 +96,14 @@ export function search(
|
||||
{ signal }
|
||||
);
|
||||
}
|
||||
|
||||
export function listSearchProviders(
|
||||
settings: ApiSettings,
|
||||
signal?: AbortSignal
|
||||
): Promise<SearchProviderListResponse> {
|
||||
return apiFetch<SearchProviderListResponse>(
|
||||
settings,
|
||||
"/api/v1/search/providers",
|
||||
{ signal }
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user