From 2453d686eb88f4d58b3c79a3ca1321b1252b0717 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 15 Oct 2018 21:54:32 -0400 Subject: [PATCH] use existing api instead of creating a new plugin --- lib/modules/console/suggestions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/modules/console/suggestions.js b/lib/modules/console/suggestions.js index c4be0080..4af7b8ee 100644 --- a/lib/modules/console/suggestions.js +++ b/lib/modules/console/suggestions.js @@ -2,6 +2,7 @@ let utils = require('../../utils/utils'); class Suggestions { constructor(embark, options) { + this.embark = embark; this.events = embark.events; this.plugins = options.plugins; this.registerApi(); @@ -10,8 +11,7 @@ class Suggestions { } registerApi() { - let plugin = this.plugins.createPlugin('consoleApi', {}); - plugin.registerAPICall('post', '/embark-api/suggestions', (req, res) => { + this.embark.registerAPICall('post', '/embark-api/suggestions', (req, res) => { let suggestions = this.getSuggestions(req.body.command) res.send({result: suggestions}) });