From b1b26862a67f60dbdad8647e5b61695b45aee6a3 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 26 Sep 2023 15:02:47 +0200 Subject: [PATCH 1/3] fix(backend): postType as array in searchPosts --- backend/src/schema/resolvers/searches.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/src/schema/resolvers/searches.ts b/backend/src/schema/resolvers/searches.ts index fba74ecc7..5f4097c17 100644 --- a/backend/src/schema/resolvers/searches.ts +++ b/backend/src/schema/resolvers/searches.ts @@ -110,7 +110,13 @@ const searchResultPromise = async (session, setup, params) => { } const searchResultCallback = (result) => { - return result.records.map((r) => r.get('result')) + const response = result.records.map((r) => r.get('result')) + if (Array.isArray(response) && response.length && response[0].__typename === 'Post') { + response.forEach((post) => { + post.postType = [post.postType] + }) + } + return response } const countResultCallback = (result) => { From 6860a196296dd4c686bdf2b3ab70e76882a57cad Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 26 Sep 2023 15:03:08 +0200 Subject: [PATCH 2/3] query postType on searchPosts --- webapp/graphql/Search.js | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp/graphql/Search.js b/webapp/graphql/Search.js index b8c4fcb51..05718a804 100644 --- a/webapp/graphql/Search.js +++ b/webapp/graphql/Search.js @@ -53,6 +53,7 @@ export const searchPosts = gql` shoutedCount clickedCount viewedTeaserCount + postType author { ...user } From 7858dc6afb921dd9b47e2eaf2b51373298c91a31 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 26 Sep 2023 17:15:14 +0200 Subject: [PATCH 3/3] add event data to search post query --- webapp/graphql/Search.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webapp/graphql/Search.js b/webapp/graphql/Search.js index 05718a804..beb017b5a 100644 --- a/webapp/graphql/Search.js +++ b/webapp/graphql/Search.js @@ -54,6 +54,15 @@ export const searchPosts = gql` clickedCount viewedTeaserCount postType + eventStart + eventEnd + eventVenue + eventLocationName + eventLocation { + lng + lat + } + eventIsOnline author { ...user }