unpkg/modules/actions/showBlacklist.js

18 lines
348 B
JavaScript
Raw Normal View History

2018-02-18 02:00:56 +00:00
const BlacklistAPI = require("../BlacklistAPI");
2017-11-11 20:18:13 +00:00
function showBlacklist(req, res) {
BlacklistAPI.getPackages().then(
blacklist => {
2018-02-18 02:00:56 +00:00
res.send({ blacklist });
2017-11-11 20:18:13 +00:00
},
error => {
2018-02-18 02:00:56 +00:00
console.error(error);
2017-11-11 20:18:13 +00:00
res.status(500).send({
2017-11-25 21:25:01 +00:00
error: "Unable to fetch blacklist"
2018-02-18 02:00:56 +00:00
});
2017-11-11 20:18:13 +00:00
}
2018-02-18 02:00:56 +00:00
);
2017-11-11 20:18:13 +00:00
}
2018-02-18 02:00:56 +00:00
module.exports = showBlacklist;