File tree 2 files changed +5
-11
lines changed
2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -33,21 +33,11 @@ export class IterableEmbeddedManager {
33
33
placementIds : number [ ]
34
34
) {
35
35
try {
36
- const params : any = { } ;
37
- if ( placementIds . length > 0 ) {
38
- params . placementIds = placementIds [ 0 ] ;
39
- if ( placementIds . length > 1 ) {
40
- params . placementIds += placementIds
41
- . slice ( 1 )
42
- . map ( ( id ) => `&placementIds=${ id } ` )
43
- . join ( '' ) ;
44
- }
45
- }
46
36
const iterableResult : any = await baseIterableRequest < IterableResponse > ( {
47
37
method : 'GET' ,
48
38
url : ENDPOINTS . get_embedded_messages . route ,
49
39
params : {
50
- ... params ,
40
+ placementIds ,
51
41
platform : WEB_PLATFORM ,
52
42
sdkVersion : SDK_VERSION ,
53
43
packageName : packageName
Original file line number Diff line number Diff line change 1
1
import Axios , { AxiosRequestConfig } from 'axios' ;
2
+ import qs from 'qs' ;
2
3
import { BASE_URL , STATIC_HEADERS , EU_ITERABLE_API } from './constants' ;
3
4
import { IterablePromise , IterableResponse } from './types' ;
4
5
import { AnySchema , ValidationError } from 'yup' ;
@@ -46,6 +47,9 @@ export const baseIterableRequest = <T = any>(
46
47
headers : {
47
48
...payload . headers ,
48
49
...STATIC_HEADERS
50
+ } ,
51
+ paramsSerializer : ( params ) => {
52
+ return qs . stringify ( params , { arrayFormat : 'repeat' } ) ;
49
53
}
50
54
} ) ;
51
55
} catch ( error ) {
You can’t perform that action at this time.
0 commit comments