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 { const req = await api.post<{ items: IPageSearch[] }>("/search", params); return req.data.items; } export async function searchSuggestions( params: SearchSuggestionParams, ): Promise { const req = await api.post("/search/suggest", params); return req.data; } export async function searchShare( params: IPageSearchParams, ): Promise { const req = await api.post<{ items: IPageSearch[] }>("/search/share-search", params); return req.data.items; } export async function searchAttachments( params: IPageSearchParams, ): Promise { const req = await api.post<{ items: IAttachmentSearch[] }>("/search-attachments", params); return req.data.items; }