Skip to content

Commit

Permalink
Fix type issues after browser duration changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dgieselaar committed Nov 21, 2019
1 parent 354fa45 commit b433369
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Setup } from '../../helpers/setup_request';
import {
Setup,
SetupTimeRange,
SetupUIFilters
} from '../../helpers/setup_request';
import { fetcher } from './fetcher';

describe('fetcher', () => {
Expand All @@ -14,7 +18,7 @@ describe('fetcher', () => {
client: { search },
indices: {},
uiFiltersES: []
} as unknown) as Setup;
} as unknown) as Setup & SetupTimeRange & SetupUIFilters;

await fetcher({ serviceName: 'testServiceName', setup });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
*/

import { Coordinate } from '../../../../typings/timeseries';
import { Setup } from '../../helpers/setup_request';
import {
Setup,
SetupTimeRange,
SetupUIFilters
} from '../../helpers/setup_request';
import { fetcher } from './fetcher';
import { transformer } from './transformer';

export interface Options {
serviceName: string;
setup: Setup;
setup: Setup & SetupTimeRange & SetupUIFilters;
}

export type AvgDurationByBrowserAPIResponse = Array<{
Expand Down
6 changes: 3 additions & 3 deletions x-pack/legacy/plugins/apm/server/routes/transaction_groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ export const transactionGroupsAvgDurationByBrowser = createRoute(() => ({
rangeRt
])
},
handler: async (req, { path }) => {
const setup = await setupRequest(req);
const { serviceName } = path;
handler: async ({ context, request }) => {
const setup = await setupRequest(context, request);
const { serviceName } = context.params.path;

return getTransactionAvgDurationByBrowser({
serviceName,
Expand Down

0 comments on commit b433369

Please sign in to comment.