feat(F-097): completed feature

This commit is contained in:
chattie
2026-08-20 22:33:07 +02:00
parent d211797a09
commit db327a8dc3
9 changed files with 143 additions and 43 deletions

View File

@@ -30,10 +30,12 @@ export async function POST(req: NextRequest) {
const cookies = req.headers.get('cookie') ?? '';
const body = await req.text();
try {
const headers: Record<string, string> = { Cookie: cookies };
if (body) headers['Content-Type'] = 'application/json';
const backendRes = await fetch(`${API}/${path}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', Cookie: cookies },
body,
headers,
...(body ? { body } : {}),
});
const setCookie = backendRes.headers.get('set-cookie');
const data = await backendRes.json().catch(() => null);