diff --git a/index.js b/index.js index 64c449b..1a7cce0 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ const cookieParser = require('cookie-parser'); const accessControl = () => { return cors({ origin: [/\.adminmate\.io$/, /localhost:\d{4}$/], - allowedHeaders: ['Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'AM-Admin-Token', 'AM-Admin-Perm-Token', 'AM-Admin-Model-Perm-Token', 'AM-Model-Fields', 'AM-Ref-Fields'], + allowedHeaders: ['Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'AM-Admin-Token', 'AM-Admin-Perm-Token', 'AM-Admin-Model-Perm-Token', 'AM-Model-Fields', 'AM-Ref-Fields', 'AM-Inline-Actions'], }); }; diff --git a/src/middlewares/guard.js b/src/middlewares/guard.js index 0053e72..a70ecc6 100644 --- a/src/middlewares/guard.js +++ b/src/middlewares/guard.js @@ -5,6 +5,9 @@ module.exports.parseQuery = (req, res, next) => { if (req.headers['am-ref-fields'] && typeof req.headers['am-ref-fields'] === 'string') { req.headers['am-ref-fields'] = JSON.parse(req.headers['am-ref-fields']); } + if (req.headers['am-inline-actions'] && typeof req.headers['am-inline-actions'] === 'string') { + req.headers['am-inline-actions'] = JSON.parse(req.headers['am-inline-actions']); + } if (req.query.filters && typeof req.query.filters === 'string') { req.query.filters = JSON.parse(req.query.filters); }