removed Hashtag search

This commit is contained in:
Moriz Wahl 2020-01-07 09:16:34 +01:00
parent 07b2b7ca3b
commit 57ab9128ea
5 changed files with 4 additions and 48 deletions

View File

@ -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()
}

View File

@ -1,4 +1,4 @@
union SearchResult = Post | User | Tag
union SearchResult = Post | User
type Query {
findResources(query: String!, limit: Int = 5): [SearchResult]!

View File

@ -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>

View File

@ -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: {

View File

@ -19,9 +19,6 @@ export const findResourcesQuery = gql`
... on User {
...user
}
... on Tag {
id
}
}
}
`