From ea42890fa17c7d71f1e2644a5397eb21fccccaac Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 24 Apr 2019 14:39:59 +0900 Subject: [PATCH] Fix bug --- CHANGELOG.md | 1 + src/server/api/endpoints/notes/search-by-tag.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f803aec84..846b9c253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ mongodb: unreleased ------------------- ### Fixes +* 投稿のタグ検索APIで大文字小文字が区別されていたのを修正 * 公開範囲がホームの投稿がグローバルTLに流れる問題を修正 * モバイルビューの投稿詳細にて acct が長いとアイコンが圧迫面接される問題を修正 diff --git a/src/server/api/endpoints/notes/search-by-tag.ts b/src/server/api/endpoints/notes/search-by-tag.ts index f89539a9b..0b49f896a 100644 --- a/src/server/api/endpoints/notes/search-by-tag.ts +++ b/src/server/api/endpoints/notes/search-by-tag.ts @@ -100,14 +100,14 @@ export default define(meta, async (ps, me) => { if (me) generateMuteQuery(query, me); if (ps.tag) { - query.andWhere(':tag = ANY(note.tags)', { tag: ps.tag }); + query.andWhere(':tag = ANY(note.tags)', { tag: ps.tag.toLowerCase() }); } else { let i = 0; query.andWhere(new Brackets(qb => { for (const tags of ps.query!) { qb.orWhere(new Brackets(qb => { for (const tag of tags) { - qb.andWhere(`:tag${i} = ANY(note.tags)`, { [`tag${i}`]: tag }); + qb.andWhere(`:tag${i} = ANY(note.tags)`, { [`tag${i}`]: tag.toLowerCase() }); i++; } }));