mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 06:25:51 +03:00
ee47dd4dae
no issue - adds new router to the frontend for handling unsubscribe - default template lives in `core/server/frontend/views/unsubscribe.hbs` - `{{error}}` is present and contains the error message when unsubscribe fails - `{{member}}` is present and contains the member email - updated unsubscribe url to match the new format
28 lines
644 B
JavaScript
28 lines
644 B
JavaScript
const ParentRouter = require('./ParentRouter');
|
|
const controllers = require('./controllers');
|
|
|
|
/**
|
|
* @description Unsubscribe Router.
|
|
*
|
|
* "/unsubscribe/" -> Unsubscribe Router
|
|
*/
|
|
class UnsubscribeRouter extends ParentRouter {
|
|
constructor() {
|
|
super('UnsubscribeRouter');
|
|
|
|
// @NOTE: hardcoded, not configurable
|
|
this.route = {value: '/unsubscribe/'};
|
|
this._registerRoutes();
|
|
}
|
|
|
|
/**
|
|
* @description Register all routes of this router.
|
|
* @private
|
|
*/
|
|
_registerRoutes() {
|
|
this.mountRoute(this.route.value, controllers.unsubscribe);
|
|
}
|
|
}
|
|
|
|
module.exports = UnsubscribeRouter;
|