feat: implement search on the frontend

This commit is contained in:
swve 2025-02-18 16:08:11 +01:00
parent 01132c3745
commit 3e67205124
4 changed files with 192 additions and 0 deletions

View file

@ -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,