Finished up with email change backend. Just need to make a prompt on the profile page for our AJAX call.

This commit is contained in:
rainbow napkin 2024-12-30 09:43:25 -05:00
parent 4a865e8aa8
commit a51152a89d
14 changed files with 444 additions and 13 deletions

View file

@ -16,8 +16,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
//At some point this will be a bit more advanced, right now it's just a placeholder :P
module.exports.errorHandler = function(res, msg, type = "Generic", status = 400){
res.status(status);
return res.send({errors: [{type, msg, date: new Date()}]});
//Some controllers do things after sending headers, for those, we should remain silent
if(!res.headersSent){
res.status(status);
return res.send({errors: [{type, msg, date: new Date()}]});
}
}
module.exports.exceptionHandler = function(res, err){