mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
adding additional backend logging on plan trigger
This commit is contained in:
parent
8594819a98
commit
c72998fa81
1 changed files with 6 additions and 19 deletions
|
|
@ -43,34 +43,21 @@ export async function POST(request: NextRequest) {
|
|||
}`,
|
||||
"Content-Type": "application/json",
|
||||
};
|
||||
// const response = await fetch(
|
||||
// `${process.env.FASTAPI_API_URL}/v1/plan/trigger`,
|
||||
// {
|
||||
// method: "POST",
|
||||
// headers: headers,
|
||||
// body: JSON.stringify(validatedBody),
|
||||
// }
|
||||
// );
|
||||
|
||||
// if (!response.ok) {
|
||||
// throw new Error("API request failed");
|
||||
// }
|
||||
|
||||
// const responseData = await response.json();
|
||||
|
||||
// return new NextResponse(JSON.stringify(responseData), {
|
||||
// status: 200,
|
||||
// });
|
||||
|
||||
console.log("Triggering plan with body: ", validatedBody);
|
||||
|
||||
const url = `${process.env.FASTAPI_API_URL}/v1/plan/trigger`;
|
||||
console.log("Triggering plan with url: ", url);
|
||||
|
||||
// For the moment, we don't await any response from the backend, since we haven't split out the trigger
|
||||
fetch(`${process.env.FASTAPI_API_URL}/v1/plan/trigger`, {
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
headers: headers,
|
||||
body: JSON.stringify(validatedBody),
|
||||
});
|
||||
|
||||
console.log("Plan triggered successfully");
|
||||
|
||||
return new NextResponse(JSON.stringify({ msg: "Job started" }), {
|
||||
status: 200,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue