Skip to content

Commit

Permalink
Forward "include_type_name" api call to ES request call
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga committed Jan 24, 2020
1 parent 92875e4 commit de48af4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { serializeTemplate } from '../../../../common/lib';

const handler: RouterRouteHandler = async (req, callWithRequest) => {
const template = req.payload as Template;
const { include_type_name } = req.query as any;
const serializedTemplate = serializeTemplate(template) as TemplateEs;

const { name, order, index_patterns, version, settings, mappings, aliases } = serializedTemplate;
Expand Down Expand Up @@ -49,6 +50,7 @@ const handler: RouterRouteHandler = async (req, callWithRequest) => {
return await callWithRequest('indices.putTemplate', {
name,
order,
include_type_name,
body: {
index_patterns,
version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { serializeTemplate } from '../../../../common/lib';

const handler: RouterRouteHandler = async (req, callWithRequest) => {
const { name } = req.params;
const { include_type_name } = req.query as any;
const template = req.payload as Template;
const serializedTemplate = serializeTemplate(template) as TemplateEs;

Expand All @@ -22,6 +23,7 @@ const handler: RouterRouteHandler = async (req, callWithRequest) => {
return await callWithRequest('indices.putTemplate', {
name,
order,
include_type_name,
body: {
index_patterns,
version,
Expand Down

0 comments on commit de48af4

Please sign in to comment.