From 5ec07ede7ce904ab135cad1d425a4957515de3a9 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 22 Feb 2023 14:58:41 +0900 Subject: [PATCH] fix types --- packages/backend/src/core/AppLockService.ts | 2 +- packages/backend/src/core/PushNotificationService.ts | 2 +- .../api/endpoints/users/search-by-username-and-host.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/core/AppLockService.ts b/packages/backend/src/core/AppLockService.ts index 5f3072a415..ee179b7f01 100644 --- a/packages/backend/src/core/AppLockService.ts +++ b/packages/backend/src/core/AppLockService.ts @@ -12,7 +12,7 @@ const retryDelay = 100; @Injectable() export class AppLockService { - private lock: (key: string, timeout?: number) => Promise<() => void>; + private lock: (key: string, timeout?: number, _?: (() => Promise) | undefined) => Promise<() => void>; constructor( @Inject(DI.redis) diff --git a/packages/backend/src/core/PushNotificationService.ts b/packages/backend/src/core/PushNotificationService.ts index 545f86d764..2cad1bc07e 100644 --- a/packages/backend/src/core/PushNotificationService.ts +++ b/packages/backend/src/core/PushNotificationService.ts @@ -22,7 +22,7 @@ type PushNotificationsTypes = { }; // Reduce length because push message servers have character limits -function truncateBody(type: T, body: pushNotificationsTypes[T]): pushNotificationsTypes[T] { +function truncateBody(type: T, body: PushNotificationsTypes[T]): PushNotificationsTypes[T] { if (typeof body !== 'object') return body; return { 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 34827547b0..1cefcf2707 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 @@ -37,13 +37,13 @@ export const paramDef = { properties: { username: { type: 'string', nullable: true }, }, - required: ['username'] + required: ['username'], }, { properties: { host: { type: 'string', nullable: true }, }, - required: ['host'] + required: ['host'], }, ], } as const; @@ -68,7 +68,7 @@ export default class extends Endpoint { super(meta, paramDef, async (ps, me) => { const setUsernameAndHostQuery = (query = this.usersRepository.createQueryBuilder('user')) => { if (ps.username) { - query.andWhere('user.usernameLower LIKE :username', { username: sqlLikeEscape(ps.username.toLowerCase()) + '%' }) + query.andWhere('user.usernameLower LIKE :username', { username: sqlLikeEscape(ps.username.toLowerCase()) + '%' }); } if (ps.host) { @@ -76,7 +76,7 @@ export default class extends Endpoint { query.andWhere('user.host IS NULL'); } else { query.andWhere('user.host LIKE :host', { - host: sqlLikeEscape(ps.host.toLowerCase()) + '%' + host: sqlLikeEscape(ps.host.toLowerCase()) + '%', }); } }