mirror of
https://github.com/docmost/docmost.git
synced 2026-05-18 23:44:24 +08:00
f12866cf42
* feat(EE): fulltext search in attachments * feat: global search - search filters - attachments search ui - and more * fix import * fix import * rename migration * add GIN index * fix table name * sanitize
37 lines
977 B
TypeScript
37 lines
977 B
TypeScript
import api from "@/lib/api-client";
|
|
import {
|
|
IAttachmentSearch,
|
|
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;
|
|
}
|
|
|
|
export async function searchAttachments(
|
|
params: IPageSearchParams,
|
|
): Promise<IAttachmentSearch[]> {
|
|
const req = await api.post<IAttachmentSearch[]>("/search-attachments", params);
|
|
return req.data;
|
|
}
|