From c69b72e1999578cba15e34677ebd366482cba734 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 9 Dec 2021 23:58:30 +0900 Subject: fix lint --- .../src/server/api/endpoints/notes/search.ts | 48 +++++++++++----------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'packages/backend/src/server/api/endpoints/notes/search.ts') diff --git a/packages/backend/src/server/api/endpoints/notes/search.ts b/packages/backend/src/server/api/endpoints/notes/search.ts index eb832a6b31..b49ee87199 100644 --- a/packages/backend/src/server/api/endpoints/notes/search.ts +++ b/packages/backend/src/server/api/endpoints/notes/search.ts @@ -17,7 +17,7 @@ export const meta = { params: { query: { - validator: $.str + validator: $.str, }, sinceId: { @@ -30,22 +30,22 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, host: { validator: $.optional.nullable.str, - default: undefined + default: undefined, }, userId: { validator: $.optional.nullable.type(ID), - default: null + default: null, }, channelId: { validator: $.optional.nullable.type(ID), - default: null + default: null, }, }, @@ -56,11 +56,11 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, errors: { - } + }, }; export default define(meta, async (ps, me) => { @@ -91,8 +91,8 @@ export default define(meta, async (ps, me) => { } else { const userQuery = ps.userId != null ? [{ term: { - userId: ps.userId - } + userId: ps.userId, + }, }] : []; const hostQuery = ps.userId == null ? @@ -100,14 +100,14 @@ export default define(meta, async (ps, me) => { bool: { must_not: { exists: { - field: 'userHost' - } - } - } + field: 'userHost', + }, + }, + }, }] : ps.host !== undefined ? [{ term: { - userHost: ps.host - } + userHost: ps.host, + }, }] : [] : []; @@ -122,15 +122,15 @@ export default define(meta, async (ps, me) => { simple_query_string: { fields: ['text'], query: ps.query.toLowerCase(), - default_operator: 'and' + default_operator: 'and', }, - }, ...hostQuery, ...userQuery] - } + }, ...hostQuery, ...userQuery], + }, }, sort: [{ - _doc: 'desc' - }] - } + _doc: 'desc', + }], + }, }); const hits = result.body.hits.hits.map((hit: any) => hit._id); @@ -140,11 +140,11 @@ export default define(meta, async (ps, me) => { // Fetch found notes const notes = await Notes.find({ where: { - id: In(hits) + id: In(hits), }, order: { - id: -1 - } + id: -1, + }, }); return await Notes.packMany(notes, me); -- cgit v1.2.3-freya