Skip to content

Commit

Permalink
feat: make bootstrap run
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Sep 13, 2023
1 parent 3fb480b commit c281c3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 11 additions & 9 deletions src/core/public/saved_objects/saved_objects_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ export class SavedObjectsClient {
namespaces: 'namespaces',
preference: 'preference',
workspaces: 'workspaces',
queryDSL: 'queryDSL',
};

const currentWorkspaceId = this._getCurrentWorkspace();
Expand All @@ -384,14 +383,17 @@ export class SavedObjectsClient {
finalWorkspaces = Array.from(new Set([currentWorkspaceId]));
}

const renamedQuery = renameKeys<SavedObjectsFindOptions, any>(renameMap, {
...options,
...(finalWorkspaces
? {
workspaces: finalWorkspaces,
}
: {}),
});
const renamedQuery = renameKeys<Omit<SavedObjectsFindOptions, 'ACLSearchParams'>, any>(
renameMap,
{
...options,
...(finalWorkspaces
? {
workspaces: finalWorkspaces,
}
: {}),
}
);
const query = pick.apply(null, [renamedQuery, ...Object.values<string>(renameMap)]) as Partial<
Record<string, any>
>;
Expand Down
2 changes: 0 additions & 2 deletions src/core/server/saved_objects/service/lib/repository.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ const create = (): jest.Mocked<ISavedObjectsRepository> => ({
deleteByNamespace: jest.fn(),
incrementCounter: jest.fn(),
addToWorkspaces: jest.fn(),
getPermissionQuery: jest.fn(),
processFindOptions: jest.fn(),
deleteByWorkspace: jest.fn(),
deleteFromWorkspaces: jest.fn(),
});
Expand Down

0 comments on commit c281c3e

Please sign in to comment.