From ec19c732e5678544d8dfd50c25f2c33e5aeb217e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Mon, 8 Jul 2019 23:10:46 +0200 Subject: [PATCH] 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. --- webapp/components/Editor/Editor.vue | 4 +++- webapp/components/FilterMenu/FilterMenu.vue | 2 +- webapp/pages/search/hashtag/_id.vue | 12 ------------ 3 files changed, 4 insertions(+), 14 deletions(-) delete mode 100644 webapp/pages/search/hashtag/_id.vue diff --git a/webapp/components/Editor/Editor.vue b/webapp/components/Editor/Editor.vue index 4413bfa0d..1d9c41129 100644 --- a/webapp/components/Editor/Editor.vue +++ b/webapp/components/Editor/Editor.vue @@ -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, }, } diff --git a/webapp/components/FilterMenu/FilterMenu.vue b/webapp/components/FilterMenu/FilterMenu.vue index 9bfb3ddba..2640cfead 100644 --- a/webapp/components/FilterMenu/FilterMenu.vue +++ b/webapp/components/FilterMenu/FilterMenu.vue @@ -49,7 +49,7 @@ export default { props: { user: { type: Object, required: true }, - hashtag: { type: Object, default: null }, + hashtag: { type: String, default: null }, }, data() { return { diff --git a/webapp/pages/search/hashtag/_id.vue b/webapp/pages/search/hashtag/_id.vue deleted file mode 100644 index d180b4e4f..000000000 --- a/webapp/pages/search/hashtag/_id.vue +++ /dev/null @@ -1,12 +0,0 @@ - - -