Skip to content

Commit

Permalink
SavedObject.find: rename references to hasReference
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Oct 30, 2020
1 parent 5727615 commit c5324ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/plugins/dashboard/public/application/legacy_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export function initDashboardApp(app, deps) {

return service.find(searchTerm, {
size: $scope.listingLimit,
references: references,
hasReference: references,
});
};
$scope.editItem = ({ id }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { StringUtils } from './helpers/string_utils';
export interface SavedObjectLoaderFindOptions {
size?: number;
fields?: string[];
references?: SavedObjectsFindOptionsReference[];
hasReference?: SavedObjectsFindOptionsReference[];
}

/**
Expand Down Expand Up @@ -138,7 +138,7 @@ export class SavedObjectLoader {
*/
private findAll(
search: string = '',
{ size = 100, fields, references }: SavedObjectLoaderFindOptions
{ size = 100, fields, hasReference }: SavedObjectLoaderFindOptions
) {
return this.savedObjectsClient
.find<Record<string, unknown>>({
Expand All @@ -149,7 +149,7 @@ export class SavedObjectLoader {
searchFields: ['title^3', 'description'],
defaultSearchOperator: 'AND',
fields,
hasReference: references,
hasReference,
} as SavedObjectsFindOptions)
.then((resp) => {
return {
Expand All @@ -159,7 +159,7 @@ export class SavedObjectLoader {
});
}

find(search: string = '', sizeOrOptions: number | SavedObjectsFindOptions = 100) {
find(search: string = '', sizeOrOptions: number | SavedObjectLoaderFindOptions = 100) {
const options: SavedObjectLoaderFindOptions =
typeof sizeOrOptions === 'number'
? {
Expand Down

0 comments on commit c5324ee

Please sign in to comment.