Skip to content

Commit

Permalink
chore(code): cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Nov 7, 2018
1 parent 20c06d8 commit 7fc4aca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/controllers/api/v1/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ var async = require('async'),

var apiSettings = {};

function defaultApiResponse(err, res) {
if (err) return res.status(400).json({success: false, error: err});

return res.json({success: true});
}

/**
* @api {put} /api/v1/settings/:setting Update Setting
Expand Down Expand Up @@ -80,10 +85,7 @@ apiSettings.updateSetting = function(req, res) {
});
});
}, function(err) {
//done
if (err) return res.status(400).json({success: false, error: err});

return res.json({success: true});
return defaultApiResponse(err, res);
});
};

Expand All @@ -102,9 +104,7 @@ apiSettings.testMailer = function(req, res) {
apiSettings.buildsass = function(req, res) {
var buildsass = require('../../../sass/buildsass');
buildsass.build(function(err) {
if (err) return res.status(400).json({success: false, error: err});

return res.json({success: true});
return defaultApiResponse(err, res);
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/sass/partials/materialize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ $medium-only: "only screen and (min-width : #{$small-screen-up}) and (max-width
height: 15px;
background-color: darken($page_content_bg, 5%);
border-radius: 15px;
margin-right: 10px;
//margin-right: 10px;
transition: background 0.3s ease;
vertical-align: middle;
margin: 0 16px;
Expand Down

0 comments on commit 7fc4aca

Please sign in to comment.