From b904b2e59eb576f6249f9332601f8bd56bdb72f3 Mon Sep 17 00:00:00 2001 From: Ishaan Date: Fri, 2 Jun 2023 16:23:39 -0400 Subject: [PATCH] fix: remove unnecessary params arg --- citrus/app/api/users/[id]/route.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); }