Skip to content

Commit

Permalink
Reindent files for tabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
elszczepano committed Mar 25, 2019
1 parent 834afd0 commit d5ddb75
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 130 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

"indent": [
"error",
4
"tab"
],
"linebreak-style": [
"error",
Expand Down
6 changes: 3 additions & 3 deletions src/middlewares/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ export default (req, res, next) => {
if (err) return next(err);
if (!user) {
return res.status(401).json({
success: false,
error: info.message || 'Invalid token.'
}
success: false,
error: info.message || 'Invalid token.'
}
);}
req.user = user;
next();
Expand Down
32 changes: 16 additions & 16 deletions src/routes/errorTicketsRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,34 @@ import { checkValidation } from '../validators/checkValidation';

const api = Router();
api.get('/',
jwtAuth,
checkPrivileges,
errorTicketController.getAll
jwtAuth,
checkPrivileges,
errorTicketController.getAll
);

api.get('/:id',
jwtAuth,
checkPrivileges,
errorTicketController.getOne
jwtAuth,
checkPrivileges,
errorTicketController.getOne
);

api.get('/users/:id',
jwtAuth,
checkPrivileges,
errorTicketController.getOne
jwtAuth,
checkPrivileges,
errorTicketController.getOne
);

api.post('/',
jwtAuth,
validateCreate,
checkValidation,
errorTicketController.createNew
jwtAuth,
validateCreate,
checkValidation,
errorTicketController.createNew
);

api.delete('/:id',
jwtAuth,
checkPrivileges,
errorTicketController.deleteOne
jwtAuth,
checkPrivileges,
errorTicketController.deleteOne
);

module.exports = api;
22 changes: 11 additions & 11 deletions src/routes/indexRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ import jwtAuth from '../middlewares/auth';
const api = Router();

api.get('/', (req, res) => {
res.status(200).json('Welcome to FindMates API.');
res.status(200).json('Welcome to FindMates API.');
});

api.get('/me',
jwtAuth, (req, res) => {
res.status(200).json(req.user);
});
jwtAuth, (req, res) => {
res.status(200).json(req.user);
});

api.post('/login',
loginCheck,
checkIfBlocked,
authController.login
loginCheck,
checkIfBlocked,
authController.login
);

api.post('/register',
upload.single('profilePicture'),
validateRegister,
checkValidation,
authController.register
upload.single('profilePicture'),
validateRegister,
checkValidation,
authController.register
);

module.exports = api;
38 changes: 19 additions & 19 deletions src/routes/matchesRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,40 @@ import { checkValidation } from '../validators/checkValidation';

const api = Router();
api.get('/',
jwtAuth,
checkPrivileges,
matchController.getAll
jwtAuth,
checkPrivileges,
matchController.getAll
);

api.get('/:id',
jwtAuth,
matchController.getOne
jwtAuth,
matchController.getOne
);

api.get('/users/:id',
jwtAuth,
matchController.getResourcesOfUser
jwtAuth,
matchController.getResourcesOfUser
);

api.post('/',
jwtAuth,
checkPrivileges,
validateCreate,
checkValidation,
matchController.createNew
jwtAuth,
checkPrivileges,
validateCreate,
checkValidation,
matchController.createNew
);

api.put('/:id',
jwtAuth,
checkPrivileges,
validateUpdate,
checkValidation,
matchController.updateOne
jwtAuth,
checkPrivileges,
validateUpdate,
checkValidation,
matchController.updateOne
);

api.delete('/:id',
jwtAuth,
matchController.deleteOne
jwtAuth,
matchController.deleteOne
);

module.exports = api;
38 changes: 19 additions & 19 deletions src/routes/messagesRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,43 @@ import { checkValidation } from '../validators/checkValidation';

const api = Router();
api.get('/',
jwtAuth,
checkPrivileges,
messageController.getAll
jwtAuth,
checkPrivileges,
messageController.getAll
);

api.get('/matches/:id',
jwtAuth,
messageController.getResourcesOfMatch
jwtAuth,
messageController.getResourcesOfMatch
);

api.get('/users/:id',
jwtAuth,
messageController.getResourcesOfUser
jwtAuth,
messageController.getResourcesOfUser
);

api.get('/:id',
jwtAuth,
messageController.getOne
jwtAuth,
messageController.getOne
);

api.post('/',
jwtAuth,
validateCreate,
checkValidation,
messageController.createNew
jwtAuth,
validateCreate,
checkValidation,
messageController.createNew
);

api.put('/:id',
jwtAuth,
validateUpdate,
checkValidation,
messageController.updateOne
jwtAuth,
validateUpdate,
checkValidation,
messageController.updateOne
);

api.delete('/:id',
jwtAuth,
messageController.deleteOne
jwtAuth,
messageController.deleteOne
);

module.exports = api;
38 changes: 19 additions & 19 deletions src/routes/pendingMatchesRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,40 @@ import checkPrivileges from '../middlewares/checkPrivileges';

const api = Router();
api.get('/',
jwtAuth,
checkPrivileges,
pendingMatchController.getAll
jwtAuth,
checkPrivileges,
pendingMatchController.getAll
);

api.get('/:id',
jwtAuth,
checkPrivileges,
pendingMatchController.getOne
jwtAuth,
checkPrivileges,
pendingMatchController.getOne
);

api.get('/users/:id',
jwtAuth,
checkPrivileges,
pendingMatchController.getResourcesOfUser
jwtAuth,
checkPrivileges,
pendingMatchController.getResourcesOfUser
);

api.post('/',
jwtAuth,
validateCreate,
checkValidation,
pendingMatchController.createNew
jwtAuth,
validateCreate,
checkValidation,
pendingMatchController.createNew
);

api.put('/:id',
jwtAuth,
validateUpdate,
checkValidation,
pendingMatchController.updateOne
jwtAuth,
validateUpdate,
checkValidation,
pendingMatchController.updateOne
);

api.delete('/:id',
jwtAuth,
pendingMatchController.deleteOne
jwtAuth,
pendingMatchController.deleteOne
);

module.exports = api;
38 changes: 19 additions & 19 deletions src/routes/privilegedUsersRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,40 @@ import checkPrivileges from '../middlewares/checkPrivileges';
const api = Router();

api.get('/',
jwtAuth,
privilegedUserController.getAll
jwtAuth,
privilegedUserController.getAll
);

api.get('/:id',
jwtAuth,
privilegedUserController.getOne
jwtAuth,
privilegedUserController.getOne
);

api.get('/users/:id',
jwtAuth,
privilegedUserController.getResourcesOfUser
jwtAuth,
privilegedUserController.getResourcesOfUser
);

api.post('/',
jwtAuth,
checkPrivileges,
validateCreate,
checkValidation,
privilegedUserController.createNew
jwtAuth,
checkPrivileges,
validateCreate,
checkValidation,
privilegedUserController.createNew
);

api.put('/:id',
jwtAuth,
checkPrivileges,
validateUpdate,
checkValidation,
privilegedUserController.updateOne
jwtAuth,
checkPrivileges,
validateUpdate,
checkValidation,
privilegedUserController.updateOne
);

api.delete('/:id',
jwtAuth,
checkPrivileges,
privilegedUserController.deleteOne
jwtAuth,
checkPrivileges,
privilegedUserController.deleteOne
);

module.exports = api;
Loading

0 comments on commit d5ddb75

Please sign in to comment.