Skip to content

Commit 733fa06

Browse files
committed
refactor: collections route
1 parent 737fdc0 commit 733fa06

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/app/collections/route.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ import { NextRequest, NextResponse } from "next/server"
33

44
export const runtime = "edge"
55

6-
export async function GET(request: NextRequest) {
7-
const searchParams = request.nextUrl.searchParams
8-
const handle = searchParams.get("handle") ?? ""
9-
const pageParam = searchParams.get("pageParam") ?? "0"
10-
const limit = searchParams.get("limit") ?? "12"
11-
const cart_id = searchParams.get("cart_id") ?? ""
6+
export async function GET(
7+
request: NextRequest,
8+
{ params }: { params: Record<string, any> }
9+
) {
10+
const { handle, pageParam, limit, cart_id } = params
1211

1312
const collection = await fetchCollection(handle)
1413
.then((res) => res)

0 commit comments

Comments
 (0)