feat: Implement name filter for get executions API endpoint
This commit is contained in:
@@ -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,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user