| import { cookies } from "next/headers"; | |
| import { NextRequest, NextResponse } from "next/server"; | |
| export async function POST(request: NextRequest) { | |
| const cookieStore = await cookies(); | |
| const token = cookieStore.get('auth_token')?.value; | |
| const { searchParams } = new URL(request.url) | |
| const criteria_id = searchParams.get("criteria_id") | |
| const body = await request.json() | |
| const res = await fetch( | |
| `https://byteriot-candidateexplorer.hf.space/CandidateExplorer/agentic/create_weight?criteria_id=${criteria_id}`, | |
| { | |
| method: "POST", | |
| headers: { | |
| "Content-Type": "application/json", | |
| Authorization: token ?? "", | |
| }, | |
| body: JSON.stringify(body), | |
| } | |
| ) | |
| const data = await res.json() | |
| return NextResponse.json(data, { status: res.status }) | |
| } |