diff --git a/js/src/graphql/search.ts b/js/src/graphql/search.ts index d846e46a4..4d40713f0 100644 --- a/js/src/graphql/search.ts +++ b/js/src/graphql/search.ts @@ -1,15 +1,28 @@ import gql from 'graphql-tag'; -export const SEARCH = gql` +export const SEARCH_EVENTS = gql` query SearchEvents($searchText: String!) { - search(search: $searchText) { - ...on Event { + searchEvents(search: $searchText) { + total, + elements { title, uuid, beginsOn, + tags { + slug, + title + }, __typename - }, - ...on Actor { + } + } +} +`; + +export const SEARCH_GROUPS = gql` +query SearchGroups($searchText: String!) { + searchGroups(search: $searchText) { + total, + elements { avatarUrl, domain, preferredUsername, diff --git a/js/src/types/search.model.ts b/js/src/types/search.model.ts index b865fbc3c..615f41dab 100644 --- a/js/src/types/search.model.ts +++ b/js/src/types/search.model.ts @@ -1,3 +1,12 @@ -export interface ISearch { - __typename: string; +import { IGroup } from '@/types/actor.model'; +import { IEvent } from '@/types/event.model'; + +export interface SearchEvent { + total: number; + elements: IEvent[]; +} + +export interface SearchGroup { + total: number; + elements: IGroup[]; } diff --git a/js/src/views/Search.vue b/js/src/views/Search.vue index 9ddd5146a..21a52bf0d 100644 --- a/js/src/views/Search.vue +++ b/js/src/views/Search.vue @@ -8,11 +8,11 @@ -
+
-
+
@@ -44,13 +44,12 @@