fix: update route params to Promise type for Next.js 16 compatibility
This commit is contained in:
parent
efa2f2a8d8
commit
16e22f330a
@ -5,7 +5,7 @@ import { getDatabase } from '@/lib/database';
|
||||
// POST - Mark goal as complete
|
||||
export async function POST(
|
||||
req: NextRequest,
|
||||
{ params }: { params: { id: string } }
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
try {
|
||||
const { userId } = await auth();
|
||||
|
||||
@ -5,7 +5,7 @@ import { getDatabase } from '@/lib/database';
|
||||
// GET - Get specific goal
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: { id: string } }
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
try {
|
||||
const { userId } = await auth();
|
||||
@ -40,7 +40,7 @@ export async function GET(
|
||||
// PUT - Update goal
|
||||
export async function PUT(
|
||||
req: NextRequest,
|
||||
{ params }: { params: { id: string } }
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
try {
|
||||
const { userId } = await auth();
|
||||
@ -82,7 +82,7 @@ export async function PUT(
|
||||
// DELETE - Delete goal
|
||||
export async function DELETE(
|
||||
req: NextRequest,
|
||||
{ params }: { params: { id: string } }
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
try {
|
||||
const { userId } = await auth();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user