feat: implement multi search on search bar

This commit is contained in:
swve 2025-04-06 13:25:30 +02:00
parent ed1ae628cb
commit 0167fecbe8
6 changed files with 413 additions and 73 deletions

View 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
}