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);