Skip to content

Commit

Permalink
refined changes for db model changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lanre-mark committed Jul 3, 2020
1 parent ce0e8c1 commit 5d16bae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion server/controllers/usersController.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const usersController = {};
// Middleware to check validity of username
usersController.checkUsername = (req, res, next) => {
const user = req.body.username.toLowerCase();

const text = `SELECT * FROM users WHERE username = '${user}'`;
pool.query(text, (err, response) => {
if (err) {
Expand Down
2 changes: 2 additions & 0 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const favorites = require('./routes/favorites');
const userInfo = require('./routes/userinfo');
const jwtContoller = require('./controllers/jwtController');
const refresh = require('./routes/refresh');
const foodPreferences = require('./routes/foodpreferences');

const app = express();

Expand All @@ -41,6 +42,7 @@ app.use('/api/logout', logout);
app.use('/api/refresh_token', refresh);
app.use('/api/user/info', userInfo);
app.use('/api/favorites', favorites);
app.use('/api/preference', foodPreferences);

// Error handler
const errorHandler = (err, req, res, next) => {
Expand Down
4 changes: 3 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ const path = require('path');
const Dotenv = require('dotenv-webpack');
const fs = require('fs');
const lessToJs = require('less-vars-to-js');
const themeVariables = lessToJs(fs.readFileSync(path.join(__dirname, './src/style/theme.less'), 'utf8'));
const themeVariables = lessToJs(
fs.readFileSync(path.join(__dirname, './src/style/theme.less'), 'utf8')
);

module.exports = {
entry: {
Expand Down

0 comments on commit 5d16bae

Please sign in to comment.