Edit Contact but without loading?
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { getContact } from "@/app/data";
|
||||
import { notFound } from "next/navigation";
|
||||
import Contact from "@/app/(sidebar)/contacts/[contactId]/Contact";
|
||||
import { fetchContact } from "@/app/(sidebar)/loaders";
|
||||
|
||||
export default async function ContactPage({
|
||||
params
|
||||
@@ -8,7 +8,7 @@ export default async function ContactPage({
|
||||
params: Promise<{ contactId: string }>
|
||||
}) {
|
||||
const { contactId } = await params;
|
||||
const contact = getContact(contactId).then((c) => {
|
||||
const contact = fetchContact(contactId).then((c) => {
|
||||
if (c === null) notFound();
|
||||
return c;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user