mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +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]}
|
RETURN resource {.*, __typename: labels(resource)[0]}
|
||||||
LIMIT $limit
|
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 session = context.driver.session()
|
||||||
const searchResultPromise = session.readTransaction(async transaction => {
|
const searchResultPromise = session.readTransaction(async transaction => {
|
||||||
@ -68,20 +59,14 @@ LIMIT $limit
|
|||||||
limit,
|
limit,
|
||||||
thisUserId,
|
thisUserId,
|
||||||
})
|
})
|
||||||
/*
|
return Promise.all([postTransactionResponse, userTransactionResponse])
|
||||||
const tagTransactionResponse = transaction.run(tagCypher, {
|
|
||||||
query: query,
|
|
||||||
limit,
|
|
||||||
}) */
|
|
||||||
return Promise.all([postTransactionResponse, userTransactionResponse]) //, tagTransactionResponse
|
|
||||||
})
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const [postResults, userResults] = await searchResultPromise //, tagResults
|
const [postResults, userResults] = await searchResultPromise
|
||||||
log(postResults)
|
log(postResults)
|
||||||
log(userResults)
|
log(userResults)
|
||||||
// log(tagResults)
|
return [...postResults.records, ...userResults.records].map(r => r.get('resource'))
|
||||||
return [...postResults.records, ...userResults.records].map(r => r.get('resource')) //, ...tagResults.records
|
|
||||||
} finally {
|
} finally {
|
||||||
session.close()
|
session.close()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
union SearchResult = Post | User | Tag
|
union SearchResult = Post | User
|
||||||
|
|
||||||
type Query {
|
type Query {
|
||||||
findResources(query: String!, limit: Int = 5): [SearchResult]!
|
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" />
|
<search-post :option="option" />
|
||||||
</span>
|
</span>
|
||||||
<span
|
|
||||||
v-if="option.__typename === 'Tag'"
|
|
||||||
:class="{ 'extra-space': isFirstOfType(option), 'flex-span': true }"
|
|
||||||
>
|
|
||||||
<search-tag :option="option" />
|
|
||||||
</span>
|
|
||||||
</template>
|
</template>
|
||||||
</ds-select>
|
</ds-select>
|
||||||
</div>
|
</div>
|
||||||
@ -65,14 +59,12 @@
|
|||||||
import { isEmpty } from 'lodash'
|
import { isEmpty } from 'lodash'
|
||||||
import SearchHeading from '~/components/generic/SearchHeading/SearchHeading.vue'
|
import SearchHeading from '~/components/generic/SearchHeading/SearchHeading.vue'
|
||||||
import SearchPost from '~/components/generic/SearchPost/SearchPost.vue'
|
import SearchPost from '~/components/generic/SearchPost/SearchPost.vue'
|
||||||
import SearchTag from '~/components/generic/SearchTag/SearchTag.vue'
|
|
||||||
import HcUser from '~/components/User/User.vue'
|
import HcUser from '~/components/User/User.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
SearchHeading,
|
SearchHeading,
|
||||||
SearchPost,
|
SearchPost,
|
||||||
SearchTag,
|
|
||||||
HcUser,
|
HcUser,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@ -19,9 +19,6 @@ export const findResourcesQuery = gql`
|
|||||||
... on User {
|
... on User {
|
||||||
...user
|
...user
|
||||||
}
|
}
|
||||||
... on Tag {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user