7de788ceed
* feat: add cross-integration entity references * fix(web): anchor entity reference menu to composer * fix: keep Kandev tasks under @ mentions * fix: address entity reference review findings * test(e2e): use option role for prompt menu * test(e2e): update passthrough mention roles * fix: preserve queued references and paginate Azure PRs
22 lines
766 B
TypeScript
22 lines
766 B
TypeScript
import { fetchJson, type ApiRequestOptions } from "../client";
|
|
import type { EntityReferenceSearchResponse } from "@/lib/types/entity-reference";
|
|
|
|
export type SearchEntityReferencesRequest = {
|
|
workspaceId: string;
|
|
query: string;
|
|
limit?: number;
|
|
};
|
|
|
|
export async function searchEntityReferences(
|
|
request: SearchEntityReferencesRequest,
|
|
options?: ApiRequestOptions,
|
|
): Promise<EntityReferenceSearchResponse> {
|
|
const query = new URLSearchParams({ q: request.query });
|
|
if (request.limit !== undefined) query.set("limit", String(request.limit));
|
|
const workspaceId = encodeURIComponent(request.workspaceId);
|
|
return fetchJson<EntityReferenceSearchResponse>(
|
|
`/api/v1/workspaces/${workspaceId}/mentions/search?${query.toString()}`,
|
|
options,
|
|
);
|
|
}
|