From 2333886ae177159a9577e4a14a9ce5e648c234fb Mon Sep 17 00:00:00 2001 From: nenohi Date: Fri, 6 Oct 2023 13:46:42 +0900 Subject: [PATCH] Update packages/backend/src/core/CustomEmojiService.ts Co-authored-by: syuilo --- packages/backend/src/core/CustomEmojiService.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/core/CustomEmojiService.ts b/packages/backend/src/core/CustomEmojiService.ts index a0d0bb95f3..617893450d 100644 --- a/packages/backend/src/core/CustomEmojiService.ts +++ b/packages/backend/src/core/CustomEmojiService.ts @@ -379,16 +379,18 @@ export class CustomEmojiService implements OnApplicationShutdown { this.cache.set(`${emoji.name} ${emoji.host}`, emoji); } } + /** * ローカル内の絵文字に重複がないかチェックします * @param name 絵文字名 */ - public async isDuplicateCheck(name: string): Promise { - return (await this.emojisRepository.findOneBy({ name, host: IsNull() })) !== null; + @bindThis + public checkDuplicate(name: string): Promise { + return this.emojisRepository.exist({ where: { name, host: IsNull() } }); } @bindThis - public async getEmojiById(id: string): Promise { + public getEmojiById(id: string): Promise { return this.emojisRepository.findOneBy({ id }); }