Skip to content

Commit

Permalink
Add am-inline-actions headers
Browse files Browse the repository at this point in the history
  • Loading branch information
marcdelalonde committed Jan 26, 2023
1 parent de54a20 commit 4074e9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
});
};

Expand Down
3 changes: 3 additions & 0 deletions src/middlewares/guard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4074e9e

Please sign in to comment.