mirror of https://gitgud.io/fatchan/jschan.git
parent
c6d646ce8d
commit
f4f88d697a
4 changed files with 19 additions and 6 deletions
@ -1,14 +1,18 @@ |
||||
'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); |
||||
} |
||||
|
||||
}; |
||||
|
Loading…
Reference in new issue