Skip to content

Commit

Permalink
fix: build fails
Browse files Browse the repository at this point in the history
  • Loading branch information
mrevanzak committed Nov 14, 2023
1 parent b098b6c commit 587f47d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/categories/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import NewCategorieModal from "@/components/categories/CategoryModal";
import { getCategories } from "@vivat/api/src/services/categories/queries";

export default async function Categories() {
const { categories } = await getCategories();
const categories = await getCategories();

return (
<main className="max-w-3xl mx-auto p-5 md:p-0 sm:pt-4">
Expand Down
8 changes: 4 additions & 4 deletions apps/nextjs/src/components/categories/CategoryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ import CategoryModal from "./CategoryModal";

type CompleteCategory = Awaited<
ReturnType<typeof services.getCategories>
>["categories"][number];
>[number];

export default function CategoryList({
categories,
}: {
categories: CompleteCategory[];
}) {
const { data: c } = api.category.getCategories.useQuery(undefined, {
initialData: { categories },
initialData: categories,
refetchOnMount: false,
});

if (c.categories.length === 0) {
if (c.length === 0) {
return <EmptyState />;
}

return (
<ul>
{c.categories.map((category) => (
{c.map((category) => (
<Category category={category} key={category.id} />
))}
</ul>
Expand Down

0 comments on commit 587f47d

Please sign in to comment.