From bbc5ba323d015a0005686e40401f37dc832de914 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 9 Aug 2021 17:53:46 +0200 Subject: [PATCH] Add pagination to featured events Closes #811 Signed-off-by: Thomas Citharel --- js/src/graphql/event.ts | 30 +++++++++++++++-------- js/src/views/Search.vue | 53 ++++++++++++++++++++++++++++++++--------- 2 files changed, 62 insertions(+), 21 deletions(-) diff --git a/js/src/graphql/event.ts b/js/src/graphql/event.ts index 600ea4db..4f1e8276 100644 --- a/js/src/graphql/event.ts +++ b/js/src/graphql/event.ts @@ -209,8 +209,18 @@ export const FETCH_EVENT_BASIC = gql` `; export const FETCH_EVENTS = gql` - query FetchEvents($orderBy: EventOrderBy, $direction: SortDirection) { - events(orderBy: $orderBy, direction: $direction) { + query FetchEvents( + $orderBy: EventOrderBy + $direction: SortDirection + $page: Int + $limit: Int + ) { + events( + orderBy: $orderBy + direction: $direction + page: $page + limit: $limit + ) { total elements { id @@ -246,14 +256,14 @@ export const FETCH_EVENTS = gql` domain name } - # attributedTo { - # avatar { - # id - # url - # }, - # preferredUsername, - # name, - # }, + attributedTo { + avatar { + id + url + } + preferredUsername + name + } category tags { ...TagFragment diff --git a/js/src/views/Search.vue b/js/src/views/Search.vue index 8866d425..5dda0542 100644 --- a/js/src/views/Search.vue +++ b/js/src/views/Search.vue @@ -69,13 +69,27 @@ >

{{ $t("Featured events") }}

-
-
- +
+
+
+ +
+
+
-