fix(backend): postType as array in searchPosts

This commit is contained in:
Moriz Wahl 2023-09-26 15:02:47 +02:00
parent 30fa8d883e
commit b1b26862a6

View File

@ -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) => {