fix: update route params to Promise type for Next.js 16 compatibility

This commit is contained in:
Aleksandar 2025-12-11 13:10:51 +01:00
parent efa2f2a8d8
commit 16e22f330a
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ import { getDatabase } from '@/lib/database';
// POST - Mark goal as complete // POST - Mark goal as complete
export async function POST( export async function POST(
req: NextRequest, req: NextRequest,
{ params }: { params: { id: string } } { params }: { params: Promise<{ id: string }> }
) { ) {
try { try {
const { userId } = await auth(); const { userId } = await auth();

View File

@ -5,7 +5,7 @@ import { getDatabase } from '@/lib/database';
// GET - Get specific goal // GET - Get specific goal
export async function GET( export async function GET(
req: NextRequest, req: NextRequest,
{ params }: { params: { id: string } } { params }: { params: Promise<{ id: string }> }
) { ) {
try { try {
const { userId } = await auth(); const { userId } = await auth();
@ -40,7 +40,7 @@ export async function GET(
// PUT - Update goal // PUT - Update goal
export async function PUT( export async function PUT(
req: NextRequest, req: NextRequest,
{ params }: { params: { id: string } } { params }: { params: Promise<{ id: string }> }
) { ) {
try { try {
const { userId } = await auth(); const { userId } = await auth();
@ -82,7 +82,7 @@ export async function PUT(
// DELETE - Delete goal // DELETE - Delete goal
export async function DELETE( export async function DELETE(
req: NextRequest, req: NextRequest,
{ params }: { params: { id: string } } { params }: { params: Promise<{ id: string }> }
) { ) {
try { try {
const { userId } = await auth(); const { userId } = await auth();