Skip to content

Commit

Permalink
address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonelizabeth committed Apr 8, 2020
1 parent 664c6ad commit d6f862c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ export function deserializePipelines(pipelinesByName: PipelinesByName): Pipeline
onFailure: on_failure,
};

// Remove any undefined values
return Object.entries(pipeline).reduce((pipelineDefinition: any, [key, value]) => {
if (value !== undefined) {
pipelineDefinition[key] = value;
}
return pipelineDefinition;
}, {});
return pipeline;
});

return deserializedPipelines;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const registerUpdateRoute = ({
},
license.guardApiRoute(async (ctx, req, res) => {
const { callAsCurrentUser } = ctx.core.elasticsearch.dataClient;
const { name } = req.params as typeof paramsSchema.type;
const { name } = req.params;
const pipeline = req.body as Pipeline;

const { description, processors, version, onFailure } = pipeline;
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/ingest_pipelines/server/services/license.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ export class License {
});
}

guardApiRoute(handler: RequestHandler) {
guardApiRoute<P, Q, B>(handler: RequestHandler<P, Q, B>) {
const license = this;

return function licenseCheck(
ctx: RequestHandlerContext,
request: KibanaRequest,
request: KibanaRequest<P, Q, B>,
response: KibanaResponseFactory
) {
const licenseStatus = license.getStatus();
Expand Down

0 comments on commit d6f862c

Please sign in to comment.