refactor(backend): 存在確認のfindOneBy
をexist
に置き換え (#11224)
* refactor(backend): 存在確認の`findOneBy`を`exist`に置き換え * cleanup
This commit is contained in:
@@ -34,11 +34,13 @@ class UserListChannel extends Channel {
|
||||
this.listId = params.listId as string;
|
||||
|
||||
// Check existence and owner
|
||||
const list = await this.userListsRepository.findOneBy({
|
||||
id: this.listId,
|
||||
userId: this.user!.id,
|
||||
const listExist = await this.userListsRepository.exist({
|
||||
where: {
|
||||
id: this.listId,
|
||||
userId: this.user!.id,
|
||||
},
|
||||
});
|
||||
if (!list) return;
|
||||
if (!listExist) return;
|
||||
|
||||
// Subscribe stream
|
||||
this.subscriber.on(`userListStream:${this.listId}`, this.send);
|
||||
|
Reference in New Issue
Block a user