Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover committed Dec 10, 2019
1 parent aef5776 commit 0587f5f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/core/public/http/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export class FetchService {
};

private createRequest(path: string, options?: HttpFetchOptions): Request {
const { query, prependBasePath: shouldPrependBasePath, ...fetchOptions } = merge(
// Merge and destructure options out that are not applicable to the Fetch API.
const { query, prependBasePath: shouldPrependBasePath, asResponse, ...fetchOptions } = merge(
{
method: 'GET',
credentials: 'same-origin',
Expand Down
6 changes: 2 additions & 4 deletions src/core/public/saved_objects/saved_objects_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,14 +464,12 @@ export class SavedObjectsClient {
* the old kfetch error format of `{res: {status: number}}` whereas `http.fetch`
* uses `{response: {status: number}}`.
*/
private async savedObjectsFetch(path: string, { method, query, body }: HttpFetchOptions) {
const response = await this.http.fetch(path, { method, query, body }).catch(err => {
private savedObjectsFetch(path: string, { method, query, body }: HttpFetchOptions) {
return this.http.fetch(path, { method, query, body }).catch(err => {
const kfetchError = Object.assign(err, { res: err.response });
delete kfetchError.response;
return Promise.reject(kfetchError);
});

return response.body;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,8 @@ describe('loader', () => {

await syncExistingFields({
dateRange: { fromDate: '1900-01-01', toDate: '2000-01-01' },
fetchJson as any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fetchJson: fetchJson as any,
indexPatterns: [{ title: 'a' }, { title: 'b' }, { title: 'c' }],
setState,
});
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/spaces/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Plugin } from './plugin';
// end public contract exports

export { SpacesPluginSetup } from './plugin';
export { SpacesServiceSetup } from './spaces_service';

export const config = { schema: ConfigSchema };
export const plugin = (initializerContext: PluginInitializerContext) =>
Expand Down

0 comments on commit 0587f5f

Please sign in to comment.