fix deprecated body-parser
This commit is contained in:
Родитель
3c50bc296b
Коммит
e787002d34
|
@ -2,7 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import bodyParser from 'body-parser'
|
||||
import express from 'express'
|
||||
import { Router } from 'express'
|
||||
|
||||
import { asyncMiddleware } from '../middleware/util.js'
|
||||
|
@ -21,7 +21,6 @@ import { unsubscribeFromEmails } from '../utils/email.js'
|
|||
import AppConstants from '../appConstants.js'
|
||||
|
||||
const router = Router()
|
||||
const urlEncodedParser = bodyParser.urlencoded({ extended: false })
|
||||
|
||||
// dashboard page
|
||||
// MNTOR-1327: for v2 release, we want to temp redirect users from dashboard
|
||||
|
@ -49,12 +48,12 @@ router.get('/settings', requireSessionUser, settingsPage)
|
|||
router.get('/logout', asyncMiddleware(logout))
|
||||
|
||||
// unsubscribe from emails
|
||||
router.get('/unsubscribe', urlEncodedParser, asyncMiddleware(unsubscribePage))
|
||||
router.get('/unsubscribe', express.urlencoded({ extended: false }), asyncMiddleware(unsubscribePage))
|
||||
router.post('/unsubscribe', asyncMiddleware(unsubscribeFromEmails))
|
||||
|
||||
router.get(
|
||||
'/unsubscribe-monthly',
|
||||
urlEncodedParser,
|
||||
express.urlencoded({ extended: false }),
|
||||
asyncMiddleware(unsubscribeMonthlyPage)
|
||||
)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче