fix: ta bort NextRequest-typning i profile/route.ts withAuth handler
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { NextRequest, NextResponse } from 'next/server';
|
import { NextResponse } from 'next/server';
|
||||||
import { withAuth } from '../../../lib/with-auth';
|
import { withAuth } from '../../../lib/with-auth';
|
||||||
|
|
||||||
const API_BASE = process.env.NEXT_PUBLIC_API_URL_INTERNAL || 'http://recipe-api:8080';
|
const API_BASE = process.env.NEXT_PUBLIC_API_URL_INTERNAL || 'http://recipe-api:8080';
|
||||||
@@ -12,7 +12,7 @@ export const GET = withAuth(async (_req, session) => {
|
|||||||
return new NextResponse(text, { status: res.status, headers: { 'Content-Type': 'application/json' } });
|
return new NextResponse(text, { status: res.status, headers: { 'Content-Type': 'application/json' } });
|
||||||
});
|
});
|
||||||
|
|
||||||
export const PATCH = withAuth(async (request: NextRequest, session) => {
|
export const PATCH = withAuth(async (request, session) => {
|
||||||
const body = await request.json();
|
const body = await request.json();
|
||||||
const res = await fetch(`${API_BASE}/api/users/me`, {
|
const res = await fetch(`${API_BASE}/api/users/me`, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
|
|||||||
Reference in New Issue
Block a user