refactor(core): Move typeorm operators from SourceControlExportService to repositories (no-changelog) (#8168)
Follow-up to: #8165
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 { SharedCredentials } from '../entities/SharedCredentials';
|
||||
import type { User } from '../entities/User';
|
||||
|
||||
@@ -21,4 +21,13 @@ export class SharedCredentialsRepository extends Repository<SharedCredentials> {
|
||||
if (!sharedCredential) return null;
|
||||
return sharedCredential.credentials;
|
||||
}
|
||||
|
||||
async findByCredentialIds(credentialIds: string[]) {
|
||||
return this.find({
|
||||
relations: ['credentials', 'role', 'user'],
|
||||
where: {
|
||||
credentialsId: In(credentialIds),
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user