Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

feat: limit number of events in the chapterCard #2127

Merged
2 changes: 1 addition & 1 deletion client/src/components/ChapterCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const ChapterCard: React.FC<ChapterCardProps> = ({ chapter }) => {
marginBlockStart={'.5em'}
gridArea="eventheader"
>
New Events
Next Events
</Text>
<GridItem area="event" paddingInline={'1em'}>
{chapter.events.map(({ id, name, start_at }) => (
Expand Down
3 changes: 2 additions & 1 deletion server/src/controllers/Chapter/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export class ChapterResolver {
where: {
AND: [{ canceled: false }, { ends_at: { gt: new Date() } }],
},
orderBy: { start_at: 'asc' },
take: 3,
orderBy: { start_at: 'desc' },
},
chapter_users: {
include: {
Expand Down