mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 02:41:50 +03:00
73f6fd8c51
no-issue This removes all references to the members labs setting, any code that was run conditionally behind this flag now runs unconditionally. * Removed usage of Members labs flag * Removed tests for Members disabled * Added dynamic keypair generation for when setting is missing
27 lines
781 B
JavaScript
27 lines
781 B
JavaScript
const debug = require('ghost-ignition').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);
|
|
};
|