mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: implement search on the frontend
This commit is contained in:
parent
01132c3745
commit
3e67205124
4 changed files with 192 additions and 0 deletions
|
|
@ -24,6 +24,22 @@ export async function getOrgCourses(
|
|||
return res
|
||||
}
|
||||
|
||||
export async function searchOrgCourses(
|
||||
org_slug: string,
|
||||
query: string,
|
||||
page: number = 1,
|
||||
limit: number = 10,
|
||||
next: any,
|
||||
access_token?: any
|
||||
) {
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}courses/org_slug/${org_slug}/search?query=${encodeURIComponent(query)}&page=${page}&limit=${limit}`,
|
||||
RequestBodyWithAuthHeader('GET', null, next, access_token)
|
||||
)
|
||||
const res = await errorHandling(result)
|
||||
return res
|
||||
}
|
||||
|
||||
export async function getCourseMetadata(
|
||||
course_uuid: any,
|
||||
next: any,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue