Skip to content

Commit

Permalink
correctly specify which fields to query
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Apr 16, 2023
1 parent 333a8bb commit 10830bf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions src/plugins/data_views/common/data_views/data_views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import type { PublicMethodsOf } from '@kbn/utility-types';
import { castEsToKbnFieldTypeName } from '@kbn/field-types';
import { FieldFormatsStartCommon, FORMATS_UI_SETTINGS } from '@kbn/field-formats-plugin/common';
import { v4 as uuidv4 } from 'uuid';
import { DATA_VIEW_SAVED_OBJECT_TYPE } from '..';
import { SavedObjectsClientCommon } from '../types';

import { createDataViewCache } from '.';
Expand Down Expand Up @@ -350,7 +349,6 @@ export class DataViewsService {
*/
private async refreshSavedObjectsCache() {
const so = await this.savedObjectsClient.find({
type: DATA_VIEW_SAVED_OBJECT_TYPE,
fields: ['title', 'type', 'typeMeta', 'name'],
perPage: 10000,
});
Expand Down Expand Up @@ -393,7 +391,6 @@ export class DataViewsService {
*/
find = async (search: string, size: number = 10): Promise<DataView[]> => {
const savedObjects = await this.savedObjectsClient.find({
type: DATA_VIEW_SAVED_OBJECT_TYPE,
fields: ['title'],
search,
searchFields: ['title'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class SavedObjectsClientServerToCommon implements SavedObjectsClientCommo
this.savedObjectClient = savedObjectClient;
}
async find<T = unknown>(options: SavedObjectsClientCommonFindArgs) {
const result = await this.savedObjectClient.find<T>(options);
const result = await this.savedObjectClient.find<T>({ ...options, type: 'index-pattern' });
return result.saved_objects;
}

Expand Down

0 comments on commit 10830bf

Please sign in to comment.