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 }); }