From d87af718f8f62cd2734fb2a5acc1d8e20a559382 Mon Sep 17 00:00:00 2001 From: Ashis Date: Thu, 26 Sep 2024 14:04:33 +0530 Subject: [PATCH 1/2] fix: changed search response --- packages/restapi/src/lib/channels/search.ts | 2 +- packages/restapi/tests/lib/channel/getChannels.test.ts | 2 +- packages/restapi/tests/lib/channel/search.test.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/restapi/src/lib/channels/search.ts b/packages/restapi/src/lib/channels/search.ts index 77b9d433e..957906537 100644 --- a/packages/restapi/src/lib/channels/search.ts +++ b/packages/restapi/src/lib/channels/search.ts @@ -44,7 +44,7 @@ export const search = async (options: SearchChannelOptionsType) => { return axiosGet(requestUrl) .then((response) => { const channels = response.data.channels; - const itemCount = response.data.total || channels.length; + const itemCount = response.data.itemCount || channels.length; const formattedResponse = { itemCount, diff --git a/packages/restapi/tests/lib/channel/getChannels.test.ts b/packages/restapi/tests/lib/channel/getChannels.test.ts index d3a0c3572..380fd3171 100644 --- a/packages/restapi/tests/lib/channel/getChannels.test.ts +++ b/packages/restapi/tests/lib/channel/getChannels.test.ts @@ -11,7 +11,7 @@ describe('PUSH_CHANNELS.getChannels', () => { console.log(res); }); - it.only('Should fetch channels based on the filter and tags', async () => { + it('Should fetch channels based on the filter and tags', async () => { const res = await getChannels({ env: ENV.DEV, tag: 'Infrastructure' diff --git a/packages/restapi/tests/lib/channel/search.test.ts b/packages/restapi/tests/lib/channel/search.test.ts index 59df81a5e..7cd27a4f6 100644 --- a/packages/restapi/tests/lib/channel/search.test.ts +++ b/packages/restapi/tests/lib/channel/search.test.ts @@ -22,10 +22,10 @@ describe('PUSH_CHANNELS.search', () => { console.log(res); }); - it('Should fetch channels based on the filter in new format', async () => { + it.only('Should fetch channels based on the filter in new format', async () => { const res = await search({ env: ENV.DEV, - query: "Channel", + query: "a", oldFormat: false, tag: "Infrastructure" }); From 6a9d71053643067765600f30dcf0d21a3fc8a320 Mon Sep 17 00:00:00 2001 From: Ashis Date: Thu, 26 Sep 2024 14:13:32 +0530 Subject: [PATCH 2/2] fix: removed only --- packages/restapi/tests/lib/channel/search.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/restapi/tests/lib/channel/search.test.ts b/packages/restapi/tests/lib/channel/search.test.ts index 7cd27a4f6..0c63ba9c5 100644 --- a/packages/restapi/tests/lib/channel/search.test.ts +++ b/packages/restapi/tests/lib/channel/search.test.ts @@ -22,7 +22,7 @@ describe('PUSH_CHANNELS.search', () => { console.log(res); }); - it.only('Should fetch channels based on the filter in new format', async () => { + it('Should fetch channels based on the filter in new format', async () => { const res = await search({ env: ENV.DEV, query: "a",