From 6dba4a145c046d32831f86344ce57f3d520d4f16 Mon Sep 17 00:00:00 2001 From: naskya Date: Tue, 23 May 2023 14:11:03 +0900 Subject: [PATCH] Format --- .../src/server/api/endpoints/admin/emoji/list-remote.ts | 4 +++- packages/backend/src/server/api/endpoints/hashtags/search.ts | 4 +++- .../server/api/endpoints/users/search-by-username-and-host.ts | 4 +++- packages/backend/src/server/api/endpoints/users/search.ts | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts b/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts index 721fd280aa..6252e7e929 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts @@ -107,7 +107,9 @@ export default define(meta, paramDef, async (ps) => { } if (ps.query) { - q.andWhere('emoji.name like :query', { query: `%${sqlLikeEscape(ps.query)}%` }); + q.andWhere("emoji.name like :query", { + query: `%${sqlLikeEscape(ps.query)}%`, + }); } const emojis = await q.orderBy("emoji.id", "DESC").take(ps.limit).getMany(); diff --git a/packages/backend/src/server/api/endpoints/hashtags/search.ts b/packages/backend/src/server/api/endpoints/hashtags/search.ts index 31bee12199..cde586af0c 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/search.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/search.ts @@ -32,7 +32,9 @@ export const paramDef = { export default define(meta, paramDef, async (ps) => { const hashtags = await Hashtags.createQueryBuilder("tag") - .where("tag.name like :q", { q: `${sqlLikeEscape(ps.query.toLowerCase())}%` }) + .where("tag.name like :q", { + q: `${sqlLikeEscape(ps.query.toLowerCase())}%`, + }) .orderBy("tag.count", "DESC") .groupBy("tag.id") .take(ps.limit) diff --git a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts index 1776c24e25..eeccf69386 100644 --- a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts +++ b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts @@ -45,7 +45,9 @@ export default define(meta, paramDef, async (ps, me) => { if (ps.host) { const q = Users.createQueryBuilder("user") .where("user.isSuspended = FALSE") - .andWhere("user.host LIKE :host", { host: `${sqlLikeEscape(ps.host.toLowerCase())}%` }); + .andWhere("user.host LIKE :host", { + host: `${sqlLikeEscape(ps.host.toLowerCase())}%`, + }); if (ps.username) { q.andWhere("user.usernameLower LIKE :username", { diff --git a/packages/backend/src/server/api/endpoints/users/search.ts b/packages/backend/src/server/api/endpoints/users/search.ts index 9676c0fe21..2d84d5bfeb 100644 --- a/packages/backend/src/server/api/endpoints/users/search.ts +++ b/packages/backend/src/server/api/endpoints/users/search.ts @@ -78,7 +78,9 @@ export default define(meta, paramDef, async (ps, me) => { const nameQuery = Users.createQueryBuilder("user") .where( new Brackets((qb) => { - qb.where("user.name ILIKE :query", { query: `%${sqlLikeEscape(ps.query)}%` }); + qb.where("user.name ILIKE :query", { + query: `%${sqlLikeEscape(ps.query)}%`, + }); // Also search username if it qualifies as username if (Users.validateLocalUsername(ps.query)) {