refactor(RunnerController.remove): only load necessary relations

This commit is contained in:
Philipp Dormann 2025-03-28 12:01:15 +01:00
parent c0d5af5d7a
commit 8c6fdb2239
Signed by: philipp
GPG Key ID: 3BB9ADD52DCA4314

View File

@ -132,7 +132,7 @@ export class RunnerController {
async remove(@Param("id") id: number, @QueryParam("force") force: boolean) {
let runner = await this.runnerRepository.findOne({ id: id });
if (!runner) { return null; }
const responseRunner = await this.runnerRepository.findOne(runner, { relations: ['scans', 'group', 'group.parentGroup', 'scans.track', 'cards'] });
const responseRunner = await this.runnerRepository.findOne(runner);
if (!runner) {
throw new RunnerNotFoundError();