Skip to content

Commit

Permalink
issue #5
Browse files Browse the repository at this point in the history
Ensured key for mapping to command adapters was lower case and trimmed.
  • Loading branch information
TylerDurham committed Jun 11, 2019
1 parent fd0eee5 commit 2d08047
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
8 changes: 5 additions & 3 deletions deployment/package/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "icd2-bot",
"version": "2.0.43",
"version": "2.0.45",
"description": "",
"main": "index.js",
"main": "./lib/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "gulp build",
"serve": "gulp serve --nopatch",
"start": "node ./lib/index.js"
},
"author": "TylerDurham <[email protected]> (https://github.com/TylerDurham)",
"license": "MIT",
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "icd2-bot",
"version": "2.0.43",
"version": "2.0.45",
"description": "",
"main": "index.js",
"main": "./lib/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "gulp build",
"serve": "gulp serve --nopatch",
"start": "node ./lib/index.js"
},
"author": "TylerDurham <[email protected]> (https://github.com/TylerDurham)",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/CommandHandlerAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class CommandHandlerAdapter {
// We found a match, so grab the commandText and the arguments
commandAlias = matches[1].trim();
args = matches[2];
cmd = this._commandMapping[commandAlias];
cmd = this._commandMapping[commandAlias.toLowerCase().trim()];
}

// Execute the command.
Expand Down
1 change: 0 additions & 1 deletion src/commands/search-codes/SearchCodesCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ async function searchCodes(query: string): Promise<IICD10SearchResults> {
const pool = await sql.connect(settings.db);

try {
log(settings.searchCodes);
const dbresults = await pool.request()
.input('keywords', sql.VarChar(150), query)
.input('maxrows', sql.Int, settings.searchCodes.maxRows)
Expand Down

0 comments on commit 2d08047

Please sign in to comment.