From 7d6cf54cf365864111d3fd2e8635ec9a6e3433e0 Mon Sep 17 00:00:00 2001 From: jajjibhai008 Date: Wed, 20 Nov 2024 15:01:37 +0500 Subject: [PATCH] feat: update pagination for reporting configurations --- src/data/services/LmsApiService.js | 2 +- src/data/services/tests/LmsApiService.test.js | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/data/services/LmsApiService.js b/src/data/services/LmsApiService.js index 7fd5fc65e..40a388e1a 100644 --- a/src/data/services/LmsApiService.js +++ b/src/data/services/LmsApiService.js @@ -120,7 +120,7 @@ class LmsApiService { } static fetchReportingConfigs(uuid) { - return LmsApiService.apiClient().get(`${LmsApiService.reportingConfigUrl}?enterprise_customer=${uuid}`); + return LmsApiService.apiClient().get(`${LmsApiService.reportingConfigUrl}?enterprise_customer=${uuid}&page_size=100`); } static fetchReportingConfigTypes(uuid) { diff --git a/src/data/services/tests/LmsApiService.test.js b/src/data/services/tests/LmsApiService.test.js index b74d78846..67d86e459 100644 --- a/src/data/services/tests/LmsApiService.test.js +++ b/src/data/services/tests/LmsApiService.test.js @@ -114,4 +114,29 @@ describe('LmsApiService', () => { }, }); }); + test('fetchReportingConfigs returns reporting configs', async () => { + axios.get.mockResolvedValue({ + status: 200, + data: { + results: [{ + active: true, + data_type: 'test-data-type', + uuid: 'test-uuid', + enterprise_customer: 'test-enterprise-customer', + }], + }, + }); + const response = await LmsApiService.fetchReportingConfigs(); + expect(response).toEqual({ + status: 200, + data: { + results: [{ + active: true, + data_type: 'test-data-type', + uuid: 'test-uuid', + enterprise_customer: 'test-enterprise-customer', + }], + }, + }); + }); });