Rest API Category Filter
-
Hi, I’m using LearnPress as a content manager in a headless UI application. I’m currently trying to filter courses based on categories using the LearnPress REST API. I have two category IDs:
66and67, and I’m using the following fetch function:const params = { ...(filter.search && { search: filter.search }), ...(filter.category && { category: filter.category }), per_page: 8, page: filter.page || 1, }; const res = await axios.get(${LMSURL}/wp-json/learnpress/v1/courses, { params, });In this case,
filter.categoryis set to the value 66, 67.The API request works, but the response includes duplicate courses likely because some courses belong to both categories.
My question is:
Is there a way to retrieve only unique courses ( no duplicates), even if they belong to both categories, using the LearnPress REST API itself?
The page I need help with: [log in to see the link]
The topic ‘Rest API Category Filter’ is closed to new replies.