Skip to content

Commit

Permalink
Fix search field
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Apr 1, 2021
1 parent 9852448 commit 2712cd9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/cases/common/api/cases/case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ export const CasesFindRequestRt = rt.partial({
page: NumberFromString,
perPage: NumberFromString,
search: rt.string,
searchFields: rt.array(rt.string),
searchFields: rt.union([rt.array(rt.string), rt.string]),
sortField: rt.string,
sortOrder: rt.union([rt.literal('desc'), rt.literal('asc')]),
class: rt.string,
owner: rt.string,
});

export const CaseResponseRt = rt.intersection([
Expand Down
6 changes: 6 additions & 0 deletions x-pack/plugins/cases/server/client/cases/find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ export const find = async ({
caseOptions: {
...queryParams,
...caseQueries.case,
searchFields:
queryParams.searchFields != null
? Array.isArray(queryParams.searchFields)
? queryParams.searchFields
: [queryParams.searchFields]
: queryParams.searchFields,
fields: queryParams.fields
? includeFieldsRequiredForAuthentication(queryParams.fields)
: queryParams.fields,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ export default ({ getService }: FtrProviderContext): void => {
supertestWithoutAuth,
user: secOnly,
space: 'space1',
appendToUrl: 'search=securitySolutionFixture+observabilityFixture&searchFields[0]=owner',
appendToUrl: 'search=securitySolutionFixture+observabilityFixture&searchFields=owner',
});

expectCasesToBeValidOwner(res.cases, 1, ['securitySolutionFixture']);
Expand Down

0 comments on commit 2712cd9

Please sign in to comment.