From 75bd7a3d75a6a387cba6da87de054501a634c147 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 3 Oct 2019 16:54:56 +0200 Subject: [PATCH] Fix edit event cache issues Signed-off-by: Thomas Citharel --- js/src/graphql/event.ts | 21 ++++++- js/src/types/current-user.model.ts | 3 +- js/src/views/Event/Edit.vue | 97 +++++++++++++++++++++++++++--- js/src/views/Event/MyEvents.vue | 3 + 4 files changed, 115 insertions(+), 9 deletions(-) diff --git a/js/src/graphql/event.ts b/js/src/graphql/event.ts index aa1798174..a3a7cd5e9 100644 --- a/js/src/graphql/event.ts +++ b/js/src/graphql/event.ts @@ -52,6 +52,7 @@ const optionsQuery = ` program, commentModeration, showParticipationPrice + __typename `; export const FETCH_EVENT = gql` @@ -62,7 +63,6 @@ export const FETCH_EVENT = gql` url, local, title, - slug, description, beginsOn, endsOn, @@ -244,6 +244,9 @@ export const CREATE_EVENT = gql` }, options { ${optionsQuery} + }, + organizerActor { + id } } } @@ -289,6 +292,8 @@ export const EDIT_EVENT = gql` id, uuid, title, + url, + local, description, beginsOn, endsOn, @@ -307,6 +312,20 @@ export const EDIT_EVENT = gql` physicalAddress { ${physicalAddressQuery} }, + organizerActor { + avatar { + url + }, + preferredUsername, + domain, + name, + url, + id, + }, + participantStats { + approved, + unapproved + }, tags { ${tagsQuery} }, diff --git a/js/src/types/current-user.model.ts b/js/src/types/current-user.model.ts index 257dbc76a..f64387835 100644 --- a/js/src/types/current-user.model.ts +++ b/js/src/types/current-user.model.ts @@ -1,4 +1,4 @@ -import { IParticipant } from '@/types/event.model'; +import { IEvent, IParticipant } from '@/types/event.model'; export enum ICurrentUserRole { USER = 'USER', @@ -12,4 +12,5 @@ export interface ICurrentUser { isLoggedIn: boolean; role: ICurrentUserRole; participations: IParticipant[]; + drafts: IEvent[]; } diff --git a/js/src/views/Event/Edit.vue b/js/src/views/Event/Edit.vue index bb997786f..b5240df7b 100644 --- a/js/src/views/Event/Edit.vue +++ b/js/src/views/Event/Edit.vue @@ -1,3 +1,4 @@ +import {ParticipantRole} from "@/types/event.model";