import { type NextRequest } from "next/server";
export async function POST(request: NextRequest) {
const headers = new Headers();
const authHeader = request.headers.get("Authorization");
if (authHeader) headers.append("Authorization", authHeader);
headers.append("Content-Type", "application/json");
const data = await request.json();
const res = await fetch(`${process.env.BACKEND_URL}/bill/`, {
method: "POST",
headers: headers,
body: JSON.stringify(data),
});
if (res.ok) {
const resdata = { message: "OK!" };
return Response.json(resdata);
}
}
i used this in my route create, the strange thing is, after i use this to successfully create one, i go to the web site, the data isn't reflect in the webpage, but its already in the db, what go wrong? the cache? | A shadcn/ui and v0 generation - v0