Get rid of obsolete /search/hashtag page

@Tirokk there is this neat URL module: https://nodejs.org/api/url.html

It has convenience methods for adding query params. I'm just not quite
sure about browser compatibility though.
This commit is contained in:
Robert Schäfer 2019-07-08 23:10:46 +02:00
parent 20c118eab1
commit ec19c732e5
3 changed files with 4 additions and 14 deletions

View File

@ -491,6 +491,8 @@ export default {
// we have to replace our suggestion text with a mention
// so it's important to pass also the position of your suggestion text
selectItem(item) {
const searchUrl = new URL('/')
searchUrl.searchParams.set('hashtag', item.name)
const typeAttrs = {
mention: {
// TODO: use router here
@ -499,7 +501,7 @@ export default {
},
hashtag: {
// TODO: Fill up with input hashtag in search field
url: `/search/hashtag/${item.name}`,
url: searchUrl.href,
label: item.name,
},
}

View File

@ -49,7 +49,7 @@
export default {
props: {
user: { type: Object, required: true },
hashtag: { type: Object, default: null },
hashtag: { type: String, default: null },
},
data() {
return {

View File

@ -1,12 +0,0 @@
<template>
<div></div>
</template>
<script>
export default {
mounted() {
const { id: hashtag } = this.$route.params
this.$router.push({ path: '/', query: { hashtag } })
},
}
</script>