]> Untitled Git - lemmy-ui.git/blob - src/shared/utils/app/fetch-search-results.ts
fix: Fix badge alignment and break out into component
[lemmy-ui.git] / src / shared / utils / app / fetch-search-results.ts
1 import { myAuth } from "@utils/app";
2 import { Search, SearchType } from "lemmy-js-client";
3 import { fetchLimit } from "../../config";
4 import { HttpService } from "../../services";
5
6 export default function fetchSearchResults(q: string, type_: SearchType) {
7   const form: Search = {
8     q,
9     type_,
10     sort: "TopAll",
11     listing_type: "All",
12     page: 1,
13     limit: fetchLimit,
14     auth: myAuth(),
15   };
16
17   return HttpService.client.search(form);
18 }