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
|
@ -34,12 +34,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
private driveFilesRepository: DriveFilesRepository,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
const file = await this.driveFilesRepository.findOneBy({
|
||||
md5: ps.md5,
|
||||
userId: me.id,
|
||||
const exist = await this.driveFilesRepository.exist({
|
||||
where: {
|
||||
md5: ps.md5,
|
||||
userId: me.id,
|
||||
},
|
||||
});
|
||||
|
||||
return file != null;
|
||||
return exist;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue