From 02c5195d9cee908c2d53344e89f98ee3b76eee7c Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Tue, 7 Apr 2020 11:08:37 +0000 Subject: [PATCH] Fix some bugs --- api/graphic/routes.mjs | 4 ++-- api/server.mjs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/graphic/routes.mjs b/api/graphic/routes.mjs index 60e188f..6d68966 100644 --- a/api/graphic/routes.mjs +++ b/api/graphic/routes.mjs @@ -41,9 +41,9 @@ export async function create(ctx, data) { data.settings.main = '<%- text %> - <%- finished %>' } - let graphics = ctx.db.get('graphics').insert(data) + let graphics = ctx.db.get('graphics') + await graphics.insert(data).write() let graphic = graphics.last().value() - await graphics.write() ctx.io.emit('graphic.single', graphic) } diff --git a/api/server.mjs b/api/server.mjs index a6f086b..48990c4 100644 --- a/api/server.mjs +++ b/api/server.mjs @@ -45,7 +45,7 @@ lowdb().then(function(db) { fileServer.serve(req, res, function (err) { if (err) { - logger.error(err); + log.error(err); res.writeHead(err.status, err.headers); res.end(err.message);