Skip to content

Commit

Permalink
fix tag search params
Browse files Browse the repository at this point in the history
  • Loading branch information
quentingrchr committed Jun 14, 2024
1 parent 9bcc750 commit 748ca83
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/app/(app)/(routes)/tags/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
import Tag from '@/components/Tag';
import ActiveTeams from '@/components/ActiveTeams';
import CustomLink from '@/components/Link';
import PopularTags from '@/components/PopularTags';
import Pagination from '@/components/list/Pagination';
import PublicDigestListItem from '@/components/teams/PublicDigestListItem';
import TeamAvatar from '@/components/teams/TeamAvatar';
import { getDiscoverDigests } from '@/services/database/digest';
import { getPopularTags, getTagBySlug } from '@/services/database/tag';
import { getRecentTeams } from '@/services/database/team';
import { Button } from '@tremor/react';
import Link from 'next/link';
import CustomLink from '@/components/Link';
import { notFound } from 'next/navigation';
import PopularTags from '@/components/PopularTags';
import ActiveTeams from '@/components/ActiveTeams';
export const dynamic = 'force-dynamic';

const PER_PAGE = 10;

const TagsPage = async ({
params,
searchParams,
}: {
params: {
slug: string;
};
searchParams?: { [key: string]: string | undefined };
}) => {
const { slug } = params;

const page = 1;
const page = Number(searchParams?.page || 1);

const tag = await getTagBySlug(slug);
if (!tag) return notFound();
const recentTeams = await getRecentTeams();
const { digests, digestsCount } = await getDiscoverDigests({
page,
perPage: 20,
perPage: PER_PAGE,
tagId: tag.id,
});
const popularTags = await getPopularTags();
Expand Down

0 comments on commit 748ca83

Please sign in to comment.