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:
Naz 2022-05-09 15:35:00 +08:00
parent 7419ff2c4f
commit e2c7c21e86

View File

@ -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') {