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'; |
'use strict'; |
||||||
|
|
||||||
module.exports = (req, res, code, page, data) => { |
module.exports = (req, res, code, page, data) => { |
||||||
|
|
||||||
res.status(code); |
res.status(code); |
||||||
|
|
||||||
if (req.body.minimal) { |
if (req.body.minimal) { |
||||||
data.minimal = true; |
data.minimal = true; |
||||||
} |
} |
||||||
|
|
||||||
if (req.headers && req.headers['x-using-xhr'] != null) { |
if (req.headers && req.headers['x-using-xhr'] != null) { |
||||||
//if sending header with js, and not a bypass_minimal page, show modal
|
//if sending header with js, and not a bypass_minimal page, show modal
|
||||||
return res.json(data); |
return res.json(data); |
||||||
} else { |
} else { |
||||||
return res.render(page, data); |
return res.render(page, data); |
||||||
} |
} |
||||||
|
|
||||||
}; |
}; |
||||||
|
Loading…
Reference in new issue