Skip to content

Commit

Permalink
fix(core): Include projectId in range query middleware (#11590)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov authored Nov 6, 2024
1 parent ca75020 commit a6070af
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,22 @@ describe('`parseRangeQuery` middleware', () => {
expect(nextFn).toBeCalledTimes(1);
});

test('should parse `projectId` field', () => {
const req = mock<ExecutionRequest.GetMany>({
query: {
filter: '{ "projectId": "123" }',
limit: undefined,
firstId: undefined,
lastId: undefined,
},
});

parseRangeQuery(req, res, nextFn);

expect(req.rangeQuery.projectId).toBe('123');
expect(nextFn).toBeCalledTimes(1);
});

test('should delete invalid fields', () => {
const req = mock<ExecutionRequest.GetMany>({
query: {
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/executions/execution.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const schemaGetExecutionsQueryFilter = {
startedBefore: { type: 'date-time' },
annotationTags: { type: 'array', items: { type: 'string' } },
vote: { type: 'string' },
projectId: { type: 'string' },
},
$defs: {
metadata: {
Expand Down

0 comments on commit a6070af

Please sign in to comment.