File tree Expand file tree Collapse file tree 4 files changed +19
-19
lines changed Expand file tree Collapse file tree 4 files changed +19
-19
lines changed Original file line number Diff line number Diff line change 1
1
const config = {
2
2
protocol : "https" ,
3
- host : "dev -cdn.contentstack.io" ,
3
+ host : "stag -cdn.contentstack.io" ,
4
4
port : 443 ,
5
5
version : "v3" ,
6
6
urls : {
Original file line number Diff line number Diff line change @@ -42,16 +42,14 @@ export default function Request(options) {
42
42
queryParams = serialize ( options . body ) ;
43
43
}
44
44
45
-
46
45
fetch ( url + '?' + queryParams , {
47
46
method : 'GET' ,
48
47
headers : headers
49
48
} )
50
49
. then ( function ( response ) {
51
-
52
50
if ( response . ok && response . status === 200 ) {
53
51
let data = response . json ( ) ;
54
- resolve ( data ) ;
52
+ resolve ( data ) ;
55
53
} else {
56
54
reject ( response . statusText ) ;
57
55
}
Original file line number Diff line number Diff line change @@ -264,14 +264,15 @@ export function sendRequest(queryObject) {
264
264
}
265
265
return ;
266
266
}
267
- } else if ( data . items ) {
268
- syncstack = {
269
- items : data . items ,
270
- pagination_token : data . pagination_token ,
271
- sync_token : data . sync_token ,
272
- total_count : data . total_count
273
- }
274
- } else {
267
+ }
268
+ else if ( data . items ) {
269
+ syncstack = {
270
+ items : data . items ,
271
+ pagination_token : data . pagination_token ,
272
+ sync_token : data . sync_token ,
273
+ total_count : data . total_count
274
+ }
275
+ } else {
275
276
entries = data ;
276
277
}
277
278
@@ -286,15 +287,16 @@ export function sendRequest(queryObject) {
286
287
}
287
288
} ) ;
288
289
return resolve ( spreadResult ( entries ) ) ;
289
- } else {
290
- if ( syncstack ) {
291
- return resolve ( syncstack ) ;
292
- }
290
+ }
291
+
292
+ if ( Object . keys ( syncstack ) . length ) {
293
+ return resolve ( syncstack ) ;
294
+ }
293
295
294
- if ( ! tojson )
295
- entries = resultWrapper ( entries ) ;
296
+ if ( ! tojson )
297
+ entries = resultWrapper ( entries ) ;
296
298
return resolve ( spreadResult ( entries ) ) ;
297
- }
299
+
298
300
} catch ( e ) {
299
301
return reject ( {
300
302
message : e . message
You can’t perform that action at this time.
0 commit comments