From ec33aa7a86340c04e658bd5e4ead90d2684b2bbb Mon Sep 17 00:00:00 2001 From: jrtechs Date: Sat, 19 Jan 2019 13:39:54 -0500 Subject: [PATCH] Fixed error with admin.js and the categories template. --- sites/admin.js | 9 +++------ templates/admin/adminHome.html | 2 +- utils/sql.js | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sites/admin.js b/sites/admin.js index 5d1f777..df5802a 100644 --- a/sites/admin.js +++ b/sites/admin.js @@ -1,9 +1,6 @@ //sending static content const includes = require('../includes/includes.js'); -//used for file IO -const utils = require('../utils/utils.js'); - //used to append static content to result const contentLoader = require('../includes/staticContentServer.js'); @@ -40,11 +37,11 @@ module.exports= const file = "../admin/admin.js"; var templateContext = Object(); - Promise.all([includes.fetchTemplate("admin/adminMain.html")], + Promise.all([includes.fetchTemplate("admin/adminMain.html"), includes.printAdminHeader(templateContext), require(file).main(request, clientAddress, templateContext, filename), - includes.printFooter(templateContext) - ).then(function(content) + includes.printFooter(templateContext), + ]).then(function(content) { result.write(whiskers.render(content[0], templateContext)); result.end(); diff --git a/templates/admin/adminHome.html b/templates/admin/adminHome.html index 2c419dd..0f7f6d4 100644 --- a/templates/admin/adminHome.html +++ b/templates/admin/adminHome.html @@ -94,7 +94,7 @@ {cat.name} {cat.url} {cat.category_id} - > + {/for} diff --git a/utils/sql.js b/utils/sql.js index 805dab6..3f8594e 100644 --- a/utils/sql.js +++ b/utils/sql.js @@ -405,7 +405,6 @@ module.exports= const q = "insert into users(user_name, password, salt) values('" + cleanName + "'," + "'" + hashedPassword.pass + "','" + hashedPassword.salt + "')"; - return insert(q); },