|
|
|
@ -4,8 +4,6 @@
|
|
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
const DTP_COMPONENT_NAME = 'newsletter';
|
|
|
|
|
|
|
|
|
|
const express = require('express');
|
|
|
|
|
const multer = require('multer');
|
|
|
|
|
|
|
|
|
@ -14,20 +12,20 @@ const { SiteController } = require('../../lib/site-lib');
|
|
|
|
|
class NewsletterController extends SiteController {
|
|
|
|
|
|
|
|
|
|
constructor (dtp) {
|
|
|
|
|
super(dtp, DTP_COMPONENT_NAME);
|
|
|
|
|
super(dtp, module.exports);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async start ( ) {
|
|
|
|
|
const { dtp } = this;
|
|
|
|
|
const { limiter: limiterService } = dtp.services;
|
|
|
|
|
|
|
|
|
|
const upload = multer({ dest: `/tmp/${this.dtp.config.site.domainKey}/uploads/${DTP_COMPONENT_NAME}` });
|
|
|
|
|
const upload = multer({ dest: `/tmp/${this.dtp.config.site.domainKey}/uploads/${module.exports.slug}` });
|
|
|
|
|
|
|
|
|
|
const router = express.Router();
|
|
|
|
|
dtp.app.use('/newsletter', router);
|
|
|
|
|
|
|
|
|
|
router.use(async (req, res, next) => {
|
|
|
|
|
res.locals.currentView = DTP_COMPONENT_NAME;
|
|
|
|
|
res.locals.currentView = module.exports.slug;
|
|
|
|
|
return next();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|