feat: Implement name filter for get executions API endpoint

This commit is contained in:
Faruk AYDIN
2025-03-20 15:01:02 +01:00
parent 245d127170
commit 906b8c94e9
3 changed files with 115 additions and 9 deletions

View File

@@ -2,17 +2,17 @@ import { renderObject } from '../../../../helpers/renderer.js';
import paginateRest from '../../../../helpers/pagination.js';
export default async (request, response) => {
const executionsQuery = request.currentUser.authorizedExecutions
.clone()
.withSoftDeleted()
.orderBy('created_at', 'desc')
.withGraphFetched({
flow: {
steps: true,
},
});
const executionsQuery = request.currentUser.getExecutions(
executionParams(request)
);
const executions = await paginateRest(executionsQuery, request.query.page);
renderObject(response, executions);
};
const executionParams = (request) => {
return {
name: request.query.name,
};
};