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
Merged
15 changes: 1 addition & 14 deletions client/graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5318,20 +5318,7 @@
{
"name": "dashboardEvents",
"description": null,
"args": [
{
"name": "limit",
"description": null,
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
Expand Down
4 changes: 0 additions & 4 deletions client/src/generated/graphql.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -576,10 +576,6 @@ export type QueryDashboardEventArgs = {
id: Scalars['Int'];
};

export type QueryDashboardEventsArgs = {
limit?: InputMaybe<Scalars['Int']>;
};

export type QueryDashboardSponsorArgs = {
id: Scalars['Int'];
};
Expand Down
1 change: 1 addition & 0 deletions server/src/controllers/Chapter/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class ChapterResolver {
where: {
AND: [{ canceled: false }, { ends_at: { gt: new Date() } }],
},
take: 3,
orderBy: { start_at: 'asc' },
Sboonny marked this conversation as resolved.
Show resolved Hide resolved
},
chapter_users: {
Expand Down
2 changes: 0 additions & 2 deletions server/src/controllers/Events/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ export class EventResolver {
@Query(() => [EventWithVenue])
async dashboardEvents(
@Ctx() ctx: Required<ResolverCtx>,
@Arg('limit', () => Int, { nullable: true }) limit?: number,
): Promise<EventWithVenue[]> {
return await prisma.events.findMany({
where: {
Expand All @@ -361,7 +360,6 @@ export class EventResolver {
}),
},
include: { venue: true },
take: limit,
orderBy: { start_at: 'asc' },
});
}
Expand Down