Skip to content

Commit

Permalink
chore!: upgrade to next 15
Browse files Browse the repository at this point in the history
  • Loading branch information
minhd-vu committed Dec 3, 2024
1 parent 90debfb commit 7c06dd8
Show file tree
Hide file tree
Showing 4 changed files with 578 additions and 137 deletions.
6 changes: 2 additions & 4 deletions app/api/user/[name]/route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import prisma from "@/lib/prisma";

export async function GET(
_: Request,
{ params }: { params: { name: string } },
) {
export async function GET(_: Request, props: { params: Promise<{ name: string }> }) {
const params = await props.params;
const users = await prisma.user.findMany({
where: {
name: {
Expand Down
11 changes: 6 additions & 5 deletions app/user/[name]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import prisma from "@/lib/prisma";
import { notFound } from "next/navigation";

export default async function UserById({
params,
}: {
params: { name: string };
}) {
export default async function UserById(
props: {
params: Promise<{ name: string }>;
}
) {
const params = await props.params;
const name = params.name;
const user = await prisma.user.findUnique({ where: { name } });

Expand Down
Loading

0 comments on commit 7c06dd8

Please sign in to comment.