Skip to content

Commit

Permalink
[Canvas] Fixes esdocs fields (elastic#34894) (elastic#35008)
Browse files Browse the repository at this point in the history
* Fixed api route for esFields

* Changes canvas api route back to /api/canvas
  • Loading branch information
cqliu1 authored Apr 12, 2019
1 parent 3b37b25 commit 4907541
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/common/lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const CANVAS_TYPE = 'canvas-workpad';
export const CANVAS_APP = 'canvas';
export const APP_ROUTE = '/app/canvas';
export const APP_ROUTE_WORKPAD = `${APP_ROUTE}#/workpad`;
export const API_ROUTE = '/api/interpreter';
export const API_ROUTE = '/api/canvas';
export const API_ROUTE_WORKPAD = `${API_ROUTE}/workpad`;
export const API_ROUTE_WORKPAD_ASSETS = `${API_ROUTE}/workpad-assets`;
export const API_ROUTE_WORKPAD_STRUCTURES = `${API_ROUTE}/workpad-structures`;
Expand Down
4 changes: 3 additions & 1 deletion x-pack/plugins/canvas/server/routes/es_fields/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
*/

import { partial } from 'lodash';
import { API_ROUTE } from '../../../common/lib/constants';
import { getESFieldTypes } from './get_es_field_types';

// TODO: Error handling, note: esErrors

export function esFields(server) {
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data');

server.route({
method: 'GET',
path: '/api/canvas/es_fields',
path: `${API_ROUTE}/es_fields`,
handler: function(request, h) {
const { index, fields } = request.query;
if (!index) {
Expand Down

0 comments on commit 4907541

Please sign in to comment.