Skip to content

Commit

Permalink
chore: #1033 update negotiator get list api params (#1846)
Browse files Browse the repository at this point in the history
  • Loading branch information
Trường An authored Jun 26, 2020
1 parent 72a7671 commit 47fad8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions packages/marketplace/src/sagas/__tests__/web-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
import { errorThrownServer } from '@/actions/error'
import errorMessages from '../../../../elements/src/utils/validators/error-messages'
import { fetchNegotiators, NegotiatorsResult } from '@/services/negotiators'
import { GET_ALL_PAGE_SIZE } from '@/constants/paginator'

describe('webComponentSagas', () => {
it('should listen request data', () => {
Expand Down Expand Up @@ -133,9 +132,7 @@ describe('fetchWebComponentConfigSaga', () => {
} as NegotiatorsResult

const gen = cloneableGenerator(fetchWebComponentConfigSaga as any)({ data: params })
expect(gen.next().value).toEqual(
all([call(fetchWebComponentConfig, params), call(fetchNegotiators, { pageSize: GET_ALL_PAGE_SIZE })]),
)
expect(gen.next().value).toEqual(all([call(fetchWebComponentConfig, params), call(fetchNegotiators, {})]))

it('api call success', () => {
const clone = gen.clone()
Expand Down
3 changes: 1 addition & 2 deletions packages/marketplace/src/sagas/web-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ import {
clientUpdateWebComponentConfigFailed,
} from '@/actions/client'
import { fetchNegotiators } from '@/services/negotiators'
import { GET_ALL_PAGE_SIZE } from '@/constants/paginator'

export const fetchWebComponentConfigSaga = function*({ data }: Action<FetchWebComponentConfigParams>) {
try {
const [webComponentConfig, negotiators] = yield all([
call(fetchWebComponentConfig, data),
call(fetchNegotiators, { pageSize: GET_ALL_PAGE_SIZE }),
call(fetchNegotiators, {}),
])
if (webComponentConfig.message) throw Error(webComponentConfig.message)
yield put(clientFetchWebComponentConfigSuccess(webComponentConfig))
Expand Down

0 comments on commit 47fad8b

Please sign in to comment.