Skip to content

Commit

Permalink
fix: changed search response
Browse files Browse the repository at this point in the history
  • Loading branch information
akp111 committed Sep 26, 2024
1 parent 27a6eee commit d87af71
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/channels/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/tests/lib/channel/getChannels.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions packages/restapi/tests/lib/channel/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
});
Expand Down

0 comments on commit d87af71

Please sign in to comment.