File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -399,9 +399,20 @@ const updateDestinations = async () => {
399
399
output += "# destination categories last updated " + todayDate + " \n" ;
400
400
output += yaml . safeDump ( { items : destinationCategories } , options ) ;
401
401
fs . writeFileSync ( path . resolve ( __dirname , `../src/_data/catalog/destination_categories.yml` ) , output ) ;
402
+ }
402
403
404
+ const updateWarehouses = async ( ) => {
405
+ while ( nextPageToken !== null ) {
406
+ const res = await getCatalog ( `${ PAPI_URL } /catalog/warehouses/` , nextPageToken )
407
+ destinations = destinations . concat ( res . data . destinationsCatalog )
408
+ nextPageToken = res . data . pagination . next
409
+ }
403
410
404
-
411
+ destinations . sort ( ( a , b ) => {
412
+ if ( a . name < b . name ) { return - 1 ; }
413
+ if ( a . name > b . name ) { return 1 ; }
414
+ return 0 ;
415
+ } )
405
416
}
406
417
407
418
updateDestinations ( )
You can’t perform that action at this time.
0 commit comments