Fix lasts events published order on the homepage
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -193,8 +193,8 @@ export const FETCH_EVENT_BASIC = gql`
|
||||
`;
|
||||
|
||||
export const FETCH_EVENTS = gql`
|
||||
query {
|
||||
events {
|
||||
query FetchEvents($orderBy: EventOrderBy, $direction: SortDirection) {
|
||||
events(orderBy: $orderBy, direction: $direction) {
|
||||
total
|
||||
elements {
|
||||
id
|
||||
|
||||
@@ -239,3 +239,14 @@ export enum ActivityGroupSubject {
|
||||
GROUP_CREATED = "group_created",
|
||||
GROUP_UPDATED = "group_updated",
|
||||
}
|
||||
|
||||
export enum EventSortField {
|
||||
BEGINS_ON = "BEGINS_ON",
|
||||
INSERTED_AT = "INSERTED_AT",
|
||||
UPDATED_AT = "UPDATED_AT",
|
||||
}
|
||||
|
||||
export enum SortDirection {
|
||||
ASC = "ASC",
|
||||
DESC = "DESC",
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue, Watch } from "vue-property-decorator";
|
||||
import { ParticipantRole } from "@/types/enums";
|
||||
import { EventSortField, ParticipantRole, SortDirection } from "@/types/enums";
|
||||
import { Paginate } from "@/types/paginate";
|
||||
import { supportsWebPFormat } from "@/utils/support";
|
||||
import { IParticipant, Participant } from "../types/participant.model";
|
||||
@@ -347,6 +347,10 @@ import Subtitle from "../components/Utils/Subtitle.vue";
|
||||
events: {
|
||||
query: FETCH_EVENTS,
|
||||
fetchPolicy: "no-cache", // Debug me: https://github.com/apollographql/apollo-client/issues/3030
|
||||
variables: {
|
||||
orderBy: EventSortField.INSERTED_AT,
|
||||
direction: SortDirection.DESC,
|
||||
},
|
||||
},
|
||||
currentActor: {
|
||||
query: CURRENT_ACTOR_CLIENT,
|
||||
|
||||
Reference in New Issue
Block a user