Added typings to the middleware to imporve checks
refs https://github.com/TryGhost/Toolbox/issues/292 - Having types would potentially have prevented a bug from a parent commit with mistyped property name
This commit is contained in:
parent
7419ff2c4f
commit
e2c7c21e86
@ -1,4 +1,10 @@
|
||||
const versionMismatchHandler = (APIVersionCompatibilityService) => {
|
||||
/**
|
||||
* @param {Object} err
|
||||
* @param {import('express').Request} req
|
||||
* @param {import('express').Response} res
|
||||
* @param {import('express').NextFunction} next
|
||||
*/
|
||||
return async (err, req, res, next) => {
|
||||
if (err && err.errorType === 'RequestNotAcceptableError') {
|
||||
if (err.code === 'UPDATE_CLIENT') {
|
||||
|
Loading…
Reference in New Issue
Block a user