fixed mail in user.ts
This commit is contained in:
		@@ -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',
 | 
			
		||||
 
 | 
			
		||||
@@ -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, <br><br> You requested to reset your password.<br>Your new password is:<br><br>' + newPass + '' +
 | 
			
		||||
            '<br><br>If you did not request a password reset, talk to the sysadmin quickly!<br><br>Have a nice day.' +
 | 
			
		||||
            '<br><br>The DeFinMa team', err => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user