diff --git a/src/helpers/mail.ts b/src/helpers/mail.ts index 901c5f5..c8291d1 100644 --- a/src/helpers/mail.ts +++ b/src/helpers/mail.ts @@ -55,7 +55,7 @@ export default class Mail{ }); } - static send (mailAddress, subject, content, f = () => {}) { // callback, executed empty or with error + static send (mailAddress, subject, content, f: (x?) => void = () => {}) { // callback, executed empty or with error if (process.env.NODE_ENV === 'production') { // only send mails in production axios({ method: 'post', diff --git a/src/routes/user.ts b/src/routes/user.ts index 7b43449..c8ebdc2 100644 --- a/src/routes/user.ts +++ b/src/routes/user.ts @@ -5,7 +5,7 @@ import _ from 'lodash'; import UserValidate from './validate/user'; import UserModel from '../models/user'; -import mail from '../helpers/mail'; +import Mail from '../helpers/mail'; import res400 from './validate/res400'; import db from '../db'; @@ -133,7 +133,7 @@ router.post('/user/passreset', (req, res, next) => { if (err) return next(err); // send email - mail(data[0].email, 'Your new password for the DeFinMa database', + Mail.send(data[0].email, 'Your new password for the DeFinMa database', 'Hi,

You requested to reset your password.
Your new password is:

' + newPass + '' + '

If you did not request a password reset, talk to the sysadmin quickly!

Have a nice day.' + '

The DeFinMa team', err => {