mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-19 22:00:50 -04:00
chore: dry out 410 logic (#45257)
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { getRedirectParams } from '../utils/redirection';
|
||||
import { deprecatedEndpoint } from '../utils/deprecatedEndpoint';
|
||||
|
||||
module.exports = function (app) {
|
||||
const router = app.loopback.Router();
|
||||
const User = app.models.User;
|
||||
|
||||
router.get('/api/github', gone);
|
||||
router.get('/api/github', deprecatedEndpoint);
|
||||
router.get('/u/:email', unsubscribeDeprecated);
|
||||
router.get('/unsubscribe/:email', unsubscribeDeprecated);
|
||||
router.get('/ue/:unsubscribeId', unsubscribeById);
|
||||
@@ -12,15 +13,6 @@ module.exports = function (app) {
|
||||
|
||||
app.use(router);
|
||||
|
||||
function gone(_, res) {
|
||||
return res.status(410).json({
|
||||
message: {
|
||||
type: 'info',
|
||||
message: 'Please reload the app, this feature is no longer available.'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function unsubscribeDeprecated(req, res) {
|
||||
req.flash(
|
||||
'info',
|
||||
|
||||
Reference in New Issue
Block a user