mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: implement multi search on search bar
This commit is contained in:
parent
ed1ae628cb
commit
0167fecbe8
6 changed files with 413 additions and 73 deletions
19
apps/web/services/search/search.ts
Normal file
19
apps/web/services/search/search.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { RequestBodyWithAuthHeader } from "@services/utils/ts/requests"
|
||||
import { getAPIUrl } from "@services/config/config"
|
||||
import { errorHandling, getResponseMetadata } from "@services/utils/ts/requests"
|
||||
|
||||
export async function searchOrgContent(
|
||||
org_slug: string,
|
||||
query: string,
|
||||
page: number = 1,
|
||||
limit: number = 10,
|
||||
next: any,
|
||||
access_token?: any
|
||||
) {
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}search/org_slug/${org_slug}?query=${encodeURIComponent(query)}&page=${page}&limit=${limit}`,
|
||||
RequestBodyWithAuthHeader('GET', null, next, access_token)
|
||||
)
|
||||
const res = await getResponseMetadata(result)
|
||||
return res
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue