[GraphQL] Move events endpoint to paginated event list

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-12-09 17:55:38 +01:00
parent 79b52c1f10
commit 8e722032fb
10 changed files with 116 additions and 142 deletions

View File

@@ -220,6 +220,7 @@
<script lang="ts">
import { Component, Vue, Watch } from "vue-property-decorator";
import { ParticipantRole } from "@/types/enums";
import { Paginate } from "@/types/paginate";
import { IParticipant, Participant } from "../types/participant.model";
import { FETCH_EVENTS } from "../graphql/event";
import EventListCard from "../components/Event/EventListCard.vue";
@@ -295,7 +296,7 @@ import Subtitle from "../components/Utils/Subtitle.vue";
},
})
export default class Home extends Vue {
events: IEvent[] = [];
events!: Paginate<IEvent>;
locations = [];
@@ -437,7 +438,7 @@ export default class Home extends Vue {
* Return all events from server excluding the ones shown as participating
*/
get filteredFeaturedEvents(): IEvent[] {
return this.events.filter(
return this.events.elements.filter(
({ id }) =>
!this.currentUserParticipations
.filter(