Now starting with real commit messages

This commit is contained in:
Janis
2022-12-27 21:31:09 +01:00
parent 90f158542a
commit 62701ca998
10 changed files with 210 additions and 38 deletions

View File

@@ -5,9 +5,13 @@ import Nav from "./Nav";
import Footer from "./Footer";
import { Category } from "@prisma/client";
import prisma from "../lib/prisma";
import { NavCategory } from "./Nav";
export async function GetCategories(): Promise<Category[]> {
return await prisma.category.findMany();
export async function GetNavCategories(): Promise<NavCategory[]> {
const result: NavCategory[] = await prisma.category.findMany({
select: { name: true, title: true },
});
return result;
}
export default async function RootLayout({
@@ -21,7 +25,7 @@ export default async function RootLayout({
<body className="body">
<header>
<Nav categories={await GetCategories()} />
<Nav categories={await GetNavCategories()} />
</header>
<main>{children}</main>
<Footer />