mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
removed Hashtag search
This commit is contained in:
parent
07b2b7ca3b
commit
57ab9128ea
@ -46,15 +46,6 @@ export default {
|
||||
RETURN resource {.*, __typename: labels(resource)[0]}
|
||||
LIMIT $limit
|
||||
`
|
||||
/*
|
||||
const tagCypher = `
|
||||
MATCH (resource:Tag)
|
||||
WHERE resource.id CONTAINS $query
|
||||
AND NOT(resource.deleted = true OR resource.disabled = true)
|
||||
RETURN resource {.*, __typename: labels(resource)[0]}
|
||||
LIMIT $limit
|
||||
`
|
||||
*/
|
||||
|
||||
const session = context.driver.session()
|
||||
const searchResultPromise = session.readTransaction(async transaction => {
|
||||
@ -68,20 +59,14 @@ LIMIT $limit
|
||||
limit,
|
||||
thisUserId,
|
||||
})
|
||||
/*
|
||||
const tagTransactionResponse = transaction.run(tagCypher, {
|
||||
query: query,
|
||||
limit,
|
||||
}) */
|
||||
return Promise.all([postTransactionResponse, userTransactionResponse]) //, tagTransactionResponse
|
||||
return Promise.all([postTransactionResponse, userTransactionResponse])
|
||||
})
|
||||
|
||||
try {
|
||||
const [postResults, userResults] = await searchResultPromise //, tagResults
|
||||
const [postResults, userResults] = await searchResultPromise
|
||||
log(postResults)
|
||||
log(userResults)
|
||||
// log(tagResults)
|
||||
return [...postResults.records, ...userResults.records].map(r => r.get('resource')) //, ...tagResults.records
|
||||
return [...postResults.records, ...userResults.records].map(r => r.get('resource'))
|
||||
} finally {
|
||||
session.close()
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
union SearchResult = Post | User | Tag
|
||||
union SearchResult = Post | User
|
||||
|
||||
type Query {
|
||||
findResources(query: String!, limit: Int = 5): [SearchResult]!
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
<template>
|
||||
<ds-flex-item>
|
||||
<span class="hashtag-search-text">#{{ option.id }}</span>
|
||||
</ds-flex-item>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'SearchTag',
|
||||
props: {
|
||||
option: { type: Object, required: true },
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.hashtag-search-text {
|
||||
color: rgb(23, 181, 63);
|
||||
}
|
||||
</style>
|
||||
@ -49,12 +49,6 @@
|
||||
>
|
||||
<search-post :option="option" />
|
||||
</span>
|
||||
<span
|
||||
v-if="option.__typename === 'Tag'"
|
||||
:class="{ 'extra-space': isFirstOfType(option), 'flex-span': true }"
|
||||
>
|
||||
<search-tag :option="option" />
|
||||
</span>
|
||||
</template>
|
||||
</ds-select>
|
||||
</div>
|
||||
@ -65,14 +59,12 @@
|
||||
import { isEmpty } from 'lodash'
|
||||
import SearchHeading from '~/components/generic/SearchHeading/SearchHeading.vue'
|
||||
import SearchPost from '~/components/generic/SearchPost/SearchPost.vue'
|
||||
import SearchTag from '~/components/generic/SearchTag/SearchTag.vue'
|
||||
import HcUser from '~/components/User/User.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
SearchHeading,
|
||||
SearchPost,
|
||||
SearchTag,
|
||||
HcUser,
|
||||
},
|
||||
props: {
|
||||
|
||||
@ -19,9 +19,6 @@ export const findResourcesQuery = gql`
|
||||
... on User {
|
||||
...user
|
||||
}
|
||||
... on Tag {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user