mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge pull request #6756 from Ocelot-Social-Community/fix-post-search
fix(backend): post type as array in search posts query
This commit is contained in:
commit
a78b6ff3b2
@ -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) => {
|
||||
|
||||
@ -53,6 +53,16 @@ export const searchPosts = gql`
|
||||
shoutedCount
|
||||
clickedCount
|
||||
viewedTeaserCount
|
||||
postType
|
||||
eventStart
|
||||
eventEnd
|
||||
eventVenue
|
||||
eventLocationName
|
||||
eventLocation {
|
||||
lng
|
||||
lat
|
||||
}
|
||||
eventIsOnline
|
||||
author {
|
||||
...user
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user