diff --git a/src/api/endpoints/posts/search.ts b/src/api/endpoints/posts/search.ts index 6e26f55390..a36d1178a5 100644 --- a/src/api/endpoints/posts/search.ts +++ b/src/api/endpoints/posts/search.ts @@ -121,6 +121,15 @@ async function search( text: x }); } else { + const tags = text.split(' ').filter(x => x[0] == '#'); + if (tags) { + push({ + $and: tags.map(x => ({ + tags: x + })) + }); + } + push({ $and: text.split(' ').map(x => ({ // キーワードが-で始まる場合そのキーワードを除外する diff --git a/src/web/app/desktop/views/components/post-detail.vue b/src/web/app/desktop/views/components/post-detail.vue index 1e31752fe7..e6e0ffa021 100644 --- a/src/web/app/desktop/views/components/post-detail.vue +++ b/src/web/app/desktop/views/components/post-detail.vue @@ -45,7 +45,7 @@
- {{ tag }} + {{ tag }}