Skip to content

Commit

Permalink
fix SO client bulkUpdate return type (#126349)
Browse files Browse the repository at this point in the history
  • Loading branch information
orouz authored Mar 6, 2022
1 parent 7af9c37 commit 23f7cff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Update multiple documents at once
<b>Signature:</b>

```typescript
bulkUpdate<T = unknown>(objects?: SavedObjectsBulkUpdateObject[]): Promise<SavedObjectsBatchResponse<unknown>>;
bulkUpdate<T = unknown>(objects?: SavedObjectsBulkUpdateObject[]): Promise<SavedObjectsBatchResponse<T>>;
```

## Parameters
Expand All @@ -20,7 +20,7 @@ bulkUpdate<T = unknown>(objects?: SavedObjectsBulkUpdateObject[]): Promise<Saved

<b>Returns:</b>

Promise&lt;SavedObjectsBatchResponse&lt;unknown&gt;&gt;
Promise&lt;SavedObjectsBatchResponse&lt;T&gt;&gt;

The result of the update operation containing both failed and updated saved objects.

2 changes: 1 addition & 1 deletion src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ export class SavedObjectsClient {
}>) => Promise<{
resolved_objects: ResolvedSimpleSavedObject<T>[];
}>;
bulkUpdate<T = unknown>(objects?: SavedObjectsBulkUpdateObject[]): Promise<SavedObjectsBatchResponse<unknown>>;
bulkUpdate<T = unknown>(objects?: SavedObjectsBulkUpdateObject[]): Promise<SavedObjectsBatchResponse<T>>;
create: <T = unknown>(type: string, attributes: T, options?: SavedObjectsCreateOptions) => Promise<SimpleSavedObject<T>>;
// Warning: (ae-forgotten-export) The symbol "SavedObjectsDeleteOptions" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "SavedObjectsClientContract" needs to be exported by the entry point index.d.ts
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/saved_objects/saved_objects_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ export class SavedObjectsClient {
return renameKeys<
PromiseType<ReturnType<SavedObjectsApi['bulkUpdate']>>,
SavedObjectsBatchResponse
>({ saved_objects: 'savedObjects' }, resp) as SavedObjectsBatchResponse;
>({ saved_objects: 'savedObjects' }, resp) as SavedObjectsBatchResponse<T>;
});
}

Expand Down

0 comments on commit 23f7cff

Please sign in to comment.