18 lines
592 B
TypeScript
18 lines
592 B
TypeScript
export async function PATCH(req: Request) {
|
|
const body = await req.text();
|
|
const auth = req.headers.get("authorization") ?? "";
|
|
const baseUrl = process.env.LEDGERONE_API_URL ?? "http://localhost:3051";
|
|
const res = await fetch(`${baseUrl}/api/auth/profile`, {
|
|
method: "PATCH",
|
|
headers: { "Content-Type": "application/json", Authorization: auth },
|
|
body
|
|
});
|
|
const payload = await res.text();
|
|
return new Response(payload, {
|
|
status: res.status,
|
|
headers: {
|
|
"Content-Type": res.headers.get("content-type") ?? "application/json"
|
|
}
|
|
});
|
|
}
|