Skip to content

Commit

Permalink
ts simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Nov 19, 2019
1 parent 69027d6 commit a95a0e1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { JobParamsPostPayloadPanelCsv, JobParamsPanelCsv } from '../../types';
export function getJobParamsFromRequest(
request: RequestFacade,
opts: { isImmediate: boolean }
): JobParamsPanelCsv {
): Partial<JobParamsPanelCsv> {
const { savedObjectType, savedObjectId } = request.params;
const { timerange, state } = request.payload as JobParamsPostPayloadPanelCsv;
const post = timerange || state ? { timerange, state } : undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function scan(pattern: string) {
}

const pattern = pathResolve(__dirname, '../../export_types/*/server/index.[jt]s');

async function exportTypesRegistryFn(server: ServerFacade) {
const logger = LevelLogger.createForServer(server, [PLUGIN_ID, 'exportTypes']);
const exportTypesRegistry = new ExportTypesRegistry();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
JobDocPayload,
JobIDForImmediate,
JobDocOutputExecuted,
ImmediateCreateJobFn,
} from '../../types';
import { getRouteOptionsCsv } from './lib/route_config_factories';
import { getJobParamsFromRequest } from '../../export_types/csv_from_savedobject/server/lib/get_job_params_from_request';
Expand Down Expand Up @@ -47,7 +46,7 @@ export function registerGenerateCsvFromSavedObjectImmediate(
handler: async (request: RequestFacade, h: ReportingResponseToolkit) => {
const logger = parentLogger.clone(['savedobject-csv']);
const jobParams = getJobParamsFromRequest(request, { isImmediate: true });
const createJobFn: ImmediateCreateJobFn = createJobFactory(server);
const createJobFn = createJobFactory(server);
const executeJobFn = executeJobFactory(server);
const jobDocPayload: JobDocPayload = await createJobFn(jobParams, request.headers, request);
const {
Expand Down

0 comments on commit a95a0e1

Please sign in to comment.