refactor(core): Move more typeorm operators to UserRepository (no-changelog) (#8165)

Follow-up to: #8163
This commit is contained in:
Iván Ovejero
2023-12-28 09:27:47 +01:00
committed by GitHub
parent 5aee7a1d48
commit 0e582594ea
3 changed files with 15 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
import { Service } from 'typedi';
import { DataSource, Repository } from 'typeorm';
import { DataSource, In, Repository } from 'typeorm';
import { User } from '../entities/User';
@Service()
@@ -7,4 +7,11 @@ export class UserRepository extends Repository<User> {
constructor(dataSource: DataSource) {
super(User, dataSource.manager);
}
async findManybyIds(userIds: string[]) {
return this.find({
where: { id: In(userIds) },
relations: ['globalRole'],
});
}
}