Skip to content

Commit

Permalink
undid changes to saved_object_store
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomThomson committed Sep 10, 2020
1 parent 18139a3 commit fd06f9d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions x-pack/plugins/lens/public/persistence/saved_object_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export interface DocumentLoader {
export type SavedObjectStore = DocumentLoader & DocumentSaver;

export class SavedObjectIndexStore implements SavedObjectStore {
constructor(private client: SavedObjectsClientContract) {}
private client: SavedObjectsClientContract;

constructor(client: SavedObjectsClientContract) {
this.client = client;
}

async save(vis: Document) {
const { id, type, references, ...rest } = vis;
Expand All @@ -53,6 +57,7 @@ export class SavedObjectIndexStore implements SavedObjectStore {
: this.client.create(DOC_TYPE, attributes, {
references,
}));

return { ...vis, id: result.id };
}

Expand Down Expand Up @@ -85,12 +90,12 @@ export class SavedObjectIndexStore implements SavedObjectStore {
if (error) {
throw error;
}
const document = {

return {
...(attributes as SavedObjectAttributes),
references,
id,
type,
} as Document;
return document;
}
}

0 comments on commit fd06f9d

Please sign in to comment.