Skip to content

Commit

Permalink
fix: remove unnecessary params arg
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaan-upadhyay committed Jun 2, 2023
1 parent 441f8a2 commit b904b2e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions citrus/app/api/users/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit b904b2e

Please sign in to comment.