@@ -25,8 +25,6 @@ const EQUIPMENT_FIELD_IDS = {
25
25
LARGEKIDSBIKE : 1006 ,
26
26
}
27
27
28
- // const endpoint = 'https://bmsstage.bonzabiketours.com:3001/octo/v1/';
29
-
30
28
const CONCURRENCY = 3 ; // is this ok ?
31
29
32
30
const isNilOrEmpty = R . either ( R . isNil , R . isEmpty ) ;
@@ -361,6 +359,11 @@ class Plugin {
361
359
assert ( R . path ( [ 'surname' ] , holder ) , 'a holder\' surname is required' ) ;
362
360
assert ( R . path ( [ 'emailAddress' ] , holder ) , 'a holder\' email is required' ) ;
363
361
362
+ let uiEndPoint = "https://bms.bonzabiketours.com/" ;
363
+ if ( endpoint . includes ( "bmsstage" ) ) {
364
+ uiEndPoint = "https://bmsstage.bonzabiketours.com/" ;
365
+ }
366
+
364
367
const inputDataForBooking = await jwt . verify ( availabilityKey , this . jwtKey ) ;
365
368
console . log ( "OPTION ID: " + inputDataForBooking . optionId ) ;
366
369
@@ -586,8 +589,9 @@ class Plugin {
586
589
headers,
587
590
} ) ) ;
588
591
589
- console . log ( "booking: " + JSON . stringify ( booking ) ) ;
592
+ // console.log("booking: " + JSON.stringify(booking));
590
593
594
+ // console.log("uiEndPoint: " + uiEndPoint);
591
595
// Get the booking
592
596
let newBooking = R . path ( [ 'data' ] , await axios ( {
593
597
method : 'get' ,
@@ -599,6 +603,7 @@ class Plugin {
599
603
booking : await translateBooking ( {
600
604
rootValue : {
601
605
...newBooking ,
606
+ uiEndPoint
602
607
} ,
603
608
typeDefs : bookingTypeDefs ,
604
609
query : bookingQuery ,
@@ -696,6 +701,11 @@ class Plugin {
696
701
apiKey : apiKey ,
697
702
} ) ;
698
703
704
+ let uiEndPoint = "https://bms.bonzabiketours.com/" ;
705
+ if ( endpoint . includes ( "bmsstage" ) ) {
706
+ uiEndPoint = "https://bmsstage.bonzabiketours.com/" ;
707
+ }
708
+
699
709
const bookingsFound = await ( async ( ) => {
700
710
if ( ! isNilOrEmpty ( bookingId ) ) {
701
711
console . log ( "BookingID: calling search by URL" ) ;
@@ -767,6 +777,7 @@ class Plugin {
767
777
return translateBooking ( {
768
778
rootValue : {
769
779
...booking ,
780
+ uiEndPoint
770
781
// product,
771
782
// option: product.options.find(o => o.optionId === booking.optionId),
772
783
} ,
0 commit comments