mirror of
https://github.com/luxfi/pics.git
synced 2026-10-30 15:22:15 +00:00
19 lines
345 B
JavaScript
19 lines
345 B
JavaScript
'use strict';
|
|
|
|
module.exports = (req, res, code, page, data) => {
|
|
|
|
res.status(code);
|
|
|
|
if (req.body.minimal) {
|
|
data.minimal = true;
|
|
}
|
|
|
|
if (req.headers && req.headers['x-using-xhr'] != null) {
|
|
//if sending header with js, and not a bypass_minimal page, show modal
|
|
return res.json(data);
|
|
} else {
|
|
return res.render(page, data);
|
|
}
|
|
|
|
};
|