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

Commit

Permalink
feat: limit number of events in the chapterCard (#2127)
Browse files Browse the repository at this point in the history
* remove extra code

* generate apollo api

* graphql slicing doesn't work in queires

* clean the queries

* can't generate apollo api that accept paginating the events

* limit the number to three events

* remove  from the queries

* fix chapter card text and order

Co-authored-by: gikf <60067306+gikf@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

Co-authored-by: gikf <60067306+gikf@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
  • Loading branch information
3 people committed Jan 8, 2023
1 parent ba43153 commit ad15ab8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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

0 comments on commit ad15ab8

Please sign in to comment.