mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
Adding header logging and error catching on fetch
This commit is contained in:
parent
c72998fa81
commit
ba9f267778
1 changed files with 4 additions and 1 deletions
|
|
@ -48,12 +48,15 @@ export async function POST(request: NextRequest) {
|
|||
|
||||
const url = `${process.env.FASTAPI_API_URL}/v1/plan/trigger`;
|
||||
console.log("Triggering plan with url: ", url);
|
||||
console.log("Triggering plan with headers: ", headers);
|
||||
|
||||
// For the moment, we don't await any response from the backend, since we haven't split out the trigger
|
||||
fetch(url, {
|
||||
void fetch(url, {
|
||||
method: "POST",
|
||||
headers: headers,
|
||||
body: JSON.stringify(validatedBody),
|
||||
}).catch((err) => {
|
||||
console.error("Error triggering FastAPI plan:", err);
|
||||
});
|
||||
|
||||
console.log("Plan triggered successfully");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue