refactor(backend): 存在確認のfindOneBy
をexist
に置き換え (#11224)
* refactor(backend): 存在確認の`findOneBy`を`exist`に置き換え * cleanup
This commit is contained in:
@@ -84,12 +84,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||
});
|
||||
|
||||
// Check if already blocking
|
||||
const exist = await this.blockingsRepository.findOneBy({
|
||||
blockerId: blocker.id,
|
||||
blockeeId: blockee.id,
|
||||
const exist = await this.blockingsRepository.exist({
|
||||
where: {
|
||||
blockerId: blocker.id,
|
||||
blockeeId: blockee.id,
|
||||
},
|
||||
});
|
||||
|
||||
if (exist != null) {
|
||||
if (exist) {
|
||||
throw new ApiError(meta.errors.alreadyBlocking);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user