refactor(backend): 存在確認のfindOneBy
をexist
に置き換え (#11224)
* refactor(backend): 存在確認の`findOneBy`を`exist`に置き換え * cleanup
This commit is contained in:
parent
48d3341462
commit
cf3e39178b
42 changed files with 287 additions and 200 deletions
|
@ -39,7 +39,7 @@ export class ClipEntityService {
|
|||
description: clip.description,
|
||||
isPublic: clip.isPublic,
|
||||
favoritedCount: await this.clipFavoritesRepository.countBy({ clipId: clip.id }),
|
||||
isFavorited: meId ? await this.clipFavoritesRepository.findOneBy({ clipId: clip.id, userId: meId }).then(x => x != null) : undefined,
|
||||
isFavorited: meId ? await this.clipFavoritesRepository.exist({ where: { clipId: clip.id, userId: meId } }) : undefined,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue