Skip to content

Commit

Permalink
Merge pull request #59 from yummy-recipes/show-dynamic-number-of-recipes
Browse files Browse the repository at this point in the history
Show dynamic number of recipes
  • Loading branch information
ertrzyiks authored Oct 7, 2023
2 parents fecd112 + d6d1687 commit 51045b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ const upperCaseFirstLetter = (string: string) => string.charAt(0).toUpperCase()

export default async function Home() {
const tags = await prisma.tag.findMany({ where: { slug: { in: tagSlugs } } })
const recipeCount = await prisma.recipe.count()

const groupLoaders = tags.sort(bySlugPosition).map(async (tag) => {

const recipes = await prisma.recipe.findMany({
where: {
tags: {
Expand Down Expand Up @@ -47,7 +49,7 @@ export default async function Home() {
Przepisy kulinarne
</h1>
<h2 className='text-lg'>
Kolekcja 118 domowych przepisów na pyszne dania
Kolekcja {recipeCount} domowych przepisów na pyszne dania
</h2>
</div>

Expand Down

0 comments on commit 51045b0

Please sign in to comment.