fix: adjust Playwright service response to match API schema expectations
This commit is contained in:
@@ -196,7 +196,7 @@ app.post('/scrape', async (req: Request, res: Response) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const pageError = pageStatusCode !== 200 ? getError(pageStatusCode) : false;
|
const pageError = pageStatusCode !== 200 ? getError(pageStatusCode) : undefined;
|
||||||
|
|
||||||
if (!pageError) {
|
if (!pageError) {
|
||||||
console.log(`✅ Scrape successful!`);
|
console.log(`✅ Scrape successful!`);
|
||||||
@@ -209,7 +209,7 @@ app.post('/scrape', async (req: Request, res: Response) => {
|
|||||||
res.json({
|
res.json({
|
||||||
content: pageContent,
|
content: pageContent,
|
||||||
pageStatusCode,
|
pageStatusCode,
|
||||||
pageError
|
...(pageError && { pageError })
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user