Skip to content

Commit

Permalink
[CLD-502] Add filter company name to search box (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
dannd4 authored Dec 12, 2019
1 parent 63dacfc commit 2348418
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/sagas/__tests__/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { clientLoading, clientReceiveData, clientRequestDataFailure } from '@/ac
import { categoriesReceiveData } from '@/actions/app-categories'
import { featuredAppsDataStub, appsDataStub } from '../__stubs__/apps'
import { cloneableGenerator } from '@redux-saga/testing-utils'
import { fetcher } from '@reapit/elements'
import { fetcher, setQueryParams } from '@reapit/elements'
import { URLS, MARKETPLACE_HEADERS } from '@/constants/api'
import { APPS_PER_PAGE, FEATURED_APPS } from '@/constants/paginator'
import { Action } from '@/types/core'
Expand All @@ -31,7 +31,14 @@ describe('client fetch data', () => {
expect(gen.next([]).value).toEqual(
all([
call(fetcher, {
url: `${URLS.apps}?clientId=1&PageNumber=${params.data.page}&PageSize=${APPS_PER_PAGE}&AppName=${params.data.search}&Category=${params.data.category}`,
url: `${URLS.apps}?${setQueryParams({
clientId: '1',
category: 'game',
appName: '1',
companyName: '1',
pageNumber: 5,
pageSize: APPS_PER_PAGE
})}`,
api: REAPIT_API_BASE_URL,
method: 'GET',
headers: MARKETPLACE_HEADERS
Expand Down
9 changes: 8 additions & 1 deletion src/sagas/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ export const clientDataFetch = function*({ data }) {

const [apps, featuredApps, categories] = yield all([
call(fetcher, {
url: `${URLS.apps}?clientId=${clientId}&PageNumber=${page}&PageSize=${APPS_PER_PAGE}&AppName=${search}&Category=${category}`,
url: `${URLS.apps}?${setQueryParams({
clientId,
category,
appName: search,
companyName: search,
pageNumber: page,
pageSize: APPS_PER_PAGE
})}`,
api: REAPIT_API_BASE_URL,
method: 'GET',
headers: MARKETPLACE_HEADERS
Expand Down

0 comments on commit 2348418

Please sign in to comment.