diff --git a/public/domna_logo_blue_transparent_background.png b/public/domna_logo_blue_transparent_background.png new file mode 100644 index 00000000..b9cc47c0 Binary files /dev/null and b/public/domna_logo_blue_transparent_background.png differ diff --git a/src/app/api/plan/trigger/route.ts b/src/app/api/plan/trigger/route.ts index 92f30961..2925a61c 100644 --- a/src/app/api/plan/trigger/route.ts +++ b/src/app/api/plan/trigger/route.ts @@ -43,34 +43,32 @@ 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); - // 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`, { + const url = `${process.env.FASTAPI_API_URL}/v1/plan/trigger`; + console.log("Triggering plan with url: ", url); + console.log("Triggering plan with headers: ", headers); + + const response = await fetch(url, { method: "POST", headers: headers, body: JSON.stringify(validatedBody), }); + console.log("Plan triggered successfully, status: %", response.statusText); + if (!response.ok) { + console.error("Error triggering plan:", response.statusText); + return new NextResponse( + JSON.stringify({ msg: "Error triggering plan" }), + { + status: 500, + } + ); + } + + const data = await response.json(); + return new NextResponse(JSON.stringify({ msg: "Job started" }), { status: 200, }); diff --git a/src/app/page.tsx b/src/app/page.tsx index 5864a2c2..85331eb8 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -34,10 +34,10 @@ export default async function Home({
Logo

Sign in to your account