mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-02 07:56:55 +01:00
Fix search-by-tag
This commit is contained in:
parent
e6754eb880
commit
c971d1d5d8
1 changed files with 2 additions and 6 deletions
|
@ -105,17 +105,13 @@ export default define(meta, async (ps, me) => {
|
|||
if (me) generateMutedUserQuery(query, me);
|
||||
|
||||
if (ps.tag) {
|
||||
if (!safeForSql(ps.tag)) return;
|
||||
query.andWhere(`'{"${normalizeForSearch(ps.tag)}"}' <@ note.tags`);
|
||||
query.andWhere(`'{"${safeForSql(ps.tag) ? normalizeForSearch(ps.tag) : 'aichan_kawaii'}"}' <@ note.tags`);
|
||||
} 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) {
|
||||
if (!safeForSql(tag)) return;
|
||||
qb.andWhere(`'{"${normalizeForSearch(ps.tag)}"}' <@ note.tags`);
|
||||
i++;
|
||||
qb.andWhere(`'{"${safeForSql(tag) ? normalizeForSearch(tag) : 'aichan_kawaii'}"}' <@ note.tags`);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue