refactor(core): Move more typeorm operators to UserRepository (no-changelog) (#8165)
Follow-up to: #8163
This commit is contained in:
@@ -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'],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user