diff --git a/citrus/app/api/users/[id]/route.ts b/citrus/app/api/users/[id]/route.ts index 9cdc275..d92fa80 100644 --- a/citrus/app/api/users/[id]/route.ts +++ b/citrus/app/api/users/[id]/route.ts @@ -2,8 +2,10 @@ import * as db from '../../../../lib/db' import { NextResponse } from 'next/server'; // Retrieve a paginated list of all users in the database -export async function GET(request: Request , { params }) { - const res = await db.query("SELECT * FROM _temp WHERE username = $1", [params.id]); +export async function GET(request: Request) { + const { searchParams } = new URL(request.url); + const id = searchParams.get('id'); + const res = await db.query("SELECT * FROM _temp WHERE username = $1", [id]); const user = res.rows; return NextResponse.json(user); }