fixes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
choelzl 2021-07-16 11:58:43 +02:00
parent 24e99bb41d
commit f42e57a3b3
Signed by: sora
GPG Key ID: A362EA0491E2EEA0
3 changed files with 10 additions and 20 deletions

View File

@ -40,17 +40,9 @@ function compileSassProduction(sassFile) {
const cssPath = path.join(__dirname, 'public/css/');
const fullCssPath = path.join(cssPath, cssFile);
return compileSass(fullSassPath).then(css => {
return new Promise((resolve, reject) => {
mkdirp(cssPath, error => {
if (error) {
return reject(error);
}
resolve();
});
}).then(() => {
return new Promise((resolve, reject) => {
return compileSass(fullSassPath).then(css =>
mkdirp(cssPath).then(() =>
new Promise((resolve, reject) => {
fs.writeFile(fullCssPath, css, error => {
if (error) {
return reject(error);
@ -58,9 +50,9 @@ function compileSassProduction(sassFile) {
resolve(cssFile);
});
});
}).catch(console.error);
});
})
)
).catch(console.error);;
}
function compileSassMain() {

View File

@ -18,6 +18,7 @@
"fastify": "latest",
"fastify-leveldb": "latest",
"fastify-static": "^2.5.0",
"mkdirp": "^1.0.4",
"node-sass": "^6.0.0"
}
}

View File

@ -24,8 +24,7 @@ module.exports = (fastify, opts, done) => {
if(req.params.id == undefined){
reply.code(400).send({error:"No ID query parameter"});
} else {
const { level } = fastify
level.get(req.params.id, (err, val) => {
fastify.level.get(req.params.id, (err, val) => {
if(err){
console.warn(err);
reply.send({name:"New Journey", main:[]});
@ -40,8 +39,7 @@ module.exports = (fastify, opts, done) => {
if(req.params.id == undefined){
reply.code(400).send({error:"No ID query parameter"});
} else {
const { level } = fastify
level.put(req.params.id, JSON.stringify(req.body), (err) => {
fastify.level.put(req.params.id, JSON.stringify(req.body), (err) => {
if(err){
console.warn(err);
reply.code(500).send({error:"Error with DB"});
@ -56,8 +54,7 @@ module.exports = (fastify, opts, done) => {
if(req.params.id == undefined){
reply.code(400).send({error:"No ID query parameter"});
} else {
const { level } = fastify
level.delete(req.params.id,(err) => {
fastify.level.delete(req.params.id,(err) => {
if(err){
console.warn(err);
reply.code(500).send({error:"Error with DB"});