Update fireEngine.ts
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import axios from "axios";
|
|
||||||
import dotenv from "dotenv";
|
import dotenv from "dotenv";
|
||||||
import { SearchResult } from "../../src/lib/entities";
|
import { SearchResult } from "../../src/lib/entities";
|
||||||
import * as Sentry from "@sentry/node";
|
import * as Sentry from "@sentry/node";
|
||||||
@@ -40,19 +39,19 @@ export async function fireEngineMap(
|
|||||||
}
|
}
|
||||||
console.log("process.env.FIRE_ENGINE_BETA_URL", process.env.FIRE_ENGINE_BETA_URL);
|
console.log("process.env.FIRE_ENGINE_BETA_URL", process.env.FIRE_ENGINE_BETA_URL);
|
||||||
|
|
||||||
let config = {
|
const response = await fetch(`${process.env.FIRE_ENGINE_BETA_URL}/search`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: `${process.env.FIRE_ENGINE_BETA_URL}/search`,
|
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"X-Disable-Cache": "true"
|
"X-Disable-Cache": "true"
|
||||||
},
|
},
|
||||||
data: data,
|
body: data
|
||||||
};
|
});
|
||||||
const response = await axios(config);
|
|
||||||
if (response && response.data) {
|
if (response.ok) {
|
||||||
console.log("response", response.data);
|
const responseData = await response.json();
|
||||||
return response.data;
|
console.log("response", responseData);
|
||||||
|
return responseData;
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user