mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
35e51e364b
no issue The only pieces of Ghost-Ignition used in Ghost were debug and logging. Both of these modules have been superceded by the Framework monorepo, and all usages of Ignition have now been removed, replaced with @tryghost/debug and @tryghost/logging.
27 lines
776 B
JavaScript
27 lines
776 B
JavaScript
const debug = require('@tryghost/debug')('services:routing:controllers:unsubscribe');
|
|
const path = require('path');
|
|
const megaService = require('../../../../server/services/mega');
|
|
const helpers = require('../../../services/routing/helpers');
|
|
|
|
module.exports = async function unsubscribeController(req, res) {
|
|
debug('unsubscribeController');
|
|
|
|
let data = {};
|
|
|
|
try {
|
|
data.member = await megaService.mega.handleUnsubscribeRequest(req);
|
|
} catch (err) {
|
|
data.error = err.message;
|
|
}
|
|
|
|
const templateName = 'unsubscribe';
|
|
|
|
res.routerOptions = {
|
|
type: 'custom',
|
|
templates: templateName,
|
|
defaultTemplate: path.resolve(__dirname, '../../../views/', templateName)
|
|
};
|
|
|
|
return helpers.renderer(req, res, data);
|
|
};
|