Linted all controllers
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
const StrayRepository = require('src/seasoned/strayRepository');
|
||||
|
||||
const strayRepository = new StrayRepository();
|
||||
|
||||
|
||||
function readStraysController(req, res) {
|
||||
const { verified, page } = req.query;
|
||||
strayRepository.readAll(verified, page)
|
||||
.then((strays) => {
|
||||
res.send(strays);
|
||||
})
|
||||
.catch((error) => {
|
||||
res.status(500).send({success: false, error: error.message });
|
||||
});
|
||||
const { verified, page } = req.query;
|
||||
strayRepository.readAll(verified, page)
|
||||
.then((strays) => {
|
||||
res.send(strays);
|
||||
})
|
||||
.catch((error) => {
|
||||
res.status(500).send({ success: false, error: error.message });
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = readStraysController;
|
||||
module.exports = readStraysController;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
const configuration = require('src/config/configuration').getInstance();
|
||||
const StrayRepository = require('src/seasoned/strayRepository');
|
||||
|
||||
const strayRepository = new StrayRepository();
|
||||
|
||||
function strayByIdController(req, res) {
|
||||
const id = req.params.strayId;
|
||||
const id = req.params.strayId;
|
||||
|
||||
strayRepository.read(id)
|
||||
.then((stray) => {
|
||||
res.send(stray);
|
||||
})
|
||||
.catch((error) => {
|
||||
res.status(500).send({ success: false, error: error.message });
|
||||
});
|
||||
strayRepository.read(id)
|
||||
.then((stray) => {
|
||||
res.send(stray);
|
||||
})
|
||||
.catch((error) => {
|
||||
res.status(500).send({ success: false, error: error.message });
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = strayByIdController;
|
||||
|
||||
@@ -3,15 +3,15 @@ const StrayRepository = require('src/seasoned/strayRepository');
|
||||
const strayRepository = new StrayRepository();
|
||||
|
||||
function verifyStrayController(req, res) {
|
||||
const id = req.params.strayId;
|
||||
const id = req.params.strayId;
|
||||
|
||||
strayRepository.verifyStray(id)
|
||||
.then(() => {
|
||||
res.send({ success: true, message: 'Episode verified' });
|
||||
})
|
||||
.catch((error) => {
|
||||
res.status(500).send({ success: false, error: error.message });
|
||||
});
|
||||
strayRepository.verifyStray(id)
|
||||
.then(() => {
|
||||
res.send({ success: true, message: 'Episode verified' });
|
||||
})
|
||||
.catch((error) => {
|
||||
res.status(500).send({ success: false, error: error.message });
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = verifyStrayController;
|
||||
|
||||
Reference in New Issue
Block a user