mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-13 20:05:55 +08:00
fix(js-sdk): check at bad if
This commit is contained in:
parent
6e1cf2f40d
commit
ad70c30be5
@ -186,7 +186,7 @@ export default class FirecrawlApp {
|
|||||||
if (typeof apiKey !== "string") {
|
if (typeof apiKey !== "string") {
|
||||||
throw new Error("No API key provided");
|
throw new Error("No API key provided");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.apiKey = apiKey;
|
this.apiKey = apiKey;
|
||||||
this.apiUrl = apiUrl || "https://api.firecrawl.dev";
|
this.apiUrl = apiUrl || "https://api.firecrawl.dev";
|
||||||
}
|
}
|
||||||
@ -346,9 +346,9 @@ export default class FirecrawlApp {
|
|||||||
`${this.apiUrl}/v1/crawl/${id}`,
|
`${this.apiUrl}/v1/crawl/${id}`,
|
||||||
headers
|
headers
|
||||||
);
|
);
|
||||||
if (response.status === 200 && getAllData) {
|
if (response.status === 200) {
|
||||||
let allData = response.data.data;
|
let allData = response.data.data;
|
||||||
if (response.data.status === "completed") {
|
if (getAllData && response.data.status === "completed") {
|
||||||
let statusData = response.data
|
let statusData = response.data
|
||||||
if ("data" in statusData) {
|
if ("data" in statusData) {
|
||||||
let data = statusData.data;
|
let data = statusData.data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user