@travelswitchhq/flight-search-react 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1323,6 +1323,16 @@ padding-inline-start: 25px;
1323
1323
 
1324
1324
  // src/Flight.tsx
1325
1325
  var import_jsx_runtime = require("react/jsx-runtime");
1326
+ var API_URLS = {
1327
+ dev: {
1328
+ airport: "https://adminapi-go.dev.futuretravelplatform.com/api",
1329
+ airline: "https://adminapi.dev.futuretravelplatform.com/api"
1330
+ },
1331
+ prod: {
1332
+ airport: "https://adminapi-go.futuretravelplatform.com/api",
1333
+ airline: "https://adminapi.futuretravelplatform.com/api"
1334
+ }
1335
+ };
1326
1336
  var normalizeDomainName = (domainName) => {
1327
1337
  const trimmed = domainName.trim();
1328
1338
  if (!trimmed) return "";
@@ -1446,8 +1456,10 @@ function FlightSearchWidget({
1446
1456
  const primaryLightColor = theme?.primaryLight ?? "#f3e2ff";
1447
1457
  const fontName = config?.fontName;
1448
1458
  const redirectionDomain = config?.redirectionDomain;
1449
- const airportSearchApiBaseUrl = "https://adminapi-go.dev.futuretravelplatform.com/api";
1450
- const airlineSearchApiBaseUrl = "https://adminapi.dev.futuretravelplatform.com/api";
1459
+ const env = config?.env ?? "dev";
1460
+ const urls = API_URLS[env];
1461
+ const airportSearchApiBaseUrl = urls.airport;
1462
+ const airlineSearchApiBaseUrl = urls.airline;
1451
1463
  const langCode = "en";
1452
1464
  const [airlineQuery, setAirlineQuery] = (0, import_react.useState)("");
1453
1465
  const [airlineSuggestions, setAirlineSuggestions] = (0, import_react.useState)([]);
@@ -2046,7 +2058,7 @@ function FlightSearchWidget({
2046
2058
  console.log("Query String:", queryString);
2047
2059
  if (redirectionDomain) {
2048
2060
  const url = `${redirectionDomain}/flight/listing?${queryString}`;
2049
- window.open(url, "_blank");
2061
+ window.location.href = url;
2050
2062
  }
2051
2063
  };
2052
2064
  const handleSubmit = (e) => {