mirror of https://gitgud.io/fatchan/jschan.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
346 B
14 lines
346 B
'use strict';
|
|
|
|
module.exports = (req, res, code, page, data) => {
|
|
if (req.body.minimal) {
|
|
data.minimal = true;
|
|
}
|
|
res.status(code);
|
|
if (req.headers['x-using-xhr'] != null && !req.body.minimal) {
|
|
//if sending header with js, and not a bypass_minimal page, show modal
|
|
return res.json(data);
|
|
} else {
|
|
return res.render(page, data);
|
|
}
|
|
}
|
|
|