mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
feat: Return scopes on executions (no-changelog) (#10310)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ExecutionRequest } from './execution.types';
|
||||
import { ExecutionRequest, type ExecutionSummaries } from './execution.types';
|
||||
import { ExecutionService } from './execution.service';
|
||||
import { Get, Post, RestController } from '@/decorators';
|
||||
import { EnterpriseExecutionsService } from './execution.service.ee';
|
||||
@@ -53,10 +53,20 @@ export class ExecutionsController {
|
||||
const noRange = !query.range.lastId || !query.range.firstId;
|
||||
|
||||
if (noStatus && noRange) {
|
||||
return await this.executionService.findLatestCurrentAndCompleted(query);
|
||||
const executions = await this.executionService.findLatestCurrentAndCompleted(query);
|
||||
await this.executionService.addScopes(
|
||||
req.user,
|
||||
executions.results as ExecutionSummaries.ExecutionSummaryWithScopes[],
|
||||
);
|
||||
return executions;
|
||||
}
|
||||
|
||||
return await this.executionService.findRangeWithCount(query);
|
||||
const executions = await this.executionService.findRangeWithCount(query);
|
||||
await this.executionService.addScopes(
|
||||
req.user,
|
||||
executions.results as ExecutionSummaries.ExecutionSummaryWithScopes[],
|
||||
);
|
||||
return executions;
|
||||
}
|
||||
|
||||
@Get('/:id')
|
||||
|
||||
Reference in New Issue
Block a user