feat: add support for pagination on learner page [BD-38] [TNL-9844] (#129)
Adds support for pagination on the learners page, including the learners list, the post, comments and responses lists.
This commit is contained in:
@@ -202,14 +202,15 @@ export async function uploadFile(blob, filename, courseId, threadKey) {
|
||||
*
|
||||
* @param {string} courseId Course ID of the course
|
||||
* @param {string} username Username of the user
|
||||
* @param {number} page
|
||||
* @returns API Response object in the format
|
||||
* {
|
||||
* results: [array of posts],
|
||||
* pagination: {count, num_pages, next, previous}
|
||||
* }
|
||||
*/
|
||||
export async function getUserPosts(courseId, username) {
|
||||
export async function getUserPosts(courseId, username, { page }) {
|
||||
const { data } = await getAuthenticatedHttpClient()
|
||||
.get(threadsApiUrl, { params: { course_id: courseId, author: username } });
|
||||
.get(threadsApiUrl, { params: { course_id: courseId, author: username, page } });
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user