From f4ced372ba53a53282bd3d2aad6147d0dcd0d363 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Thu, 22 Oct 2020 00:47:59 +0300 Subject: [PATCH] Fix SQL syntax error when using snippets --- src/data/snippets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/snippets.js b/src/data/snippets.js index 70cad4e..717c80f 100644 --- a/src/data/snippets.js +++ b/src/data/snippets.js @@ -8,7 +8,7 @@ const Snippet = require("./Snippet"); */ async function getSnippet(trigger) { const snippet = await knex("snippets") - .where(knex.raw("LOWER(trigger)"), trigger.toLowerCase()) + .where(knex.raw("LOWER(`trigger`)"), trigger.toLowerCase()) .first(); return (snippet ? new Snippet(snippet) : null); @@ -36,7 +36,7 @@ async function addSnippet(trigger, body, createdBy = 0) { */ async function deleteSnippet(trigger) { return knex("snippets") - .where(knex.raw("LOWER(trigger)"), trigger.toLowerCase()) + .where(knex.raw("LOWER(`trigger`)"), trigger.toLowerCase()) .delete(); }