Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: search response #1398

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading