mirror of
https://github.com/docmost/docmost.git
synced 2025-11-12 15:42:36 +10:00
* fix tree nodes sort * remove comment mark in shares * remove clickoutside hook for now * feat: search in shared pages * fix user-select * use Link * render page icons
29 lines
748 B
TypeScript
29 lines
748 B
TypeScript
import api from "@/lib/api-client";
|
|
import {
|
|
IPageSearch,
|
|
IPageSearchParams,
|
|
ISuggestionResult,
|
|
SearchSuggestionParams,
|
|
} from "@/features/search/types/search.types";
|
|
|
|
export async function searchPage(
|
|
params: IPageSearchParams,
|
|
): Promise<IPageSearch[]> {
|
|
const req = await api.post<IPageSearch[]>("/search", params);
|
|
return req.data;
|
|
}
|
|
|
|
export async function searchSuggestions(
|
|
params: SearchSuggestionParams,
|
|
): Promise<ISuggestionResult> {
|
|
const req = await api.post<ISuggestionResult>("/search/suggest", params);
|
|
return req.data;
|
|
}
|
|
|
|
export async function searchShare(
|
|
params: IPageSearchParams,
|
|
): Promise<IPageSearch[]> {
|
|
const req = await api.post<IPageSearch[]>("/search/share-search", params);
|
|
return req.data;
|
|
}
|