another fix
This commit is contained in:
parent
ccba392ca0
commit
7c0ff8130b
@ -18,6 +18,23 @@ class Message extends BaseModel {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$beforeUpdate() {
|
||||||
|
this.updated_at = this.formatDateForMySQL(new Date());
|
||||||
|
this.received_at = this.formatDateForMySQL(new Date());
|
||||||
|
this.created_at = this.formatDateForMySQL(new Date());
|
||||||
|
}
|
||||||
|
|
||||||
|
async $beforeInsert() {
|
||||||
|
await super.$beforeInsert();
|
||||||
|
this.updated_at = this.formatDateForMySQL(new Date());
|
||||||
|
this.received_at = this.formatDateForMySQL(new Date());
|
||||||
|
this.created_at = this.formatDateForMySQL(new Date());
|
||||||
|
}
|
||||||
|
|
||||||
|
formatDateForMySQL(date) {
|
||||||
|
return date.toISOString().slice(0, 19).replace('T', ' ');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Message;
|
module.exports = Message;
|
||||||
@ -33,7 +33,6 @@ exports.register = function () {
|
|||||||
subject: subject,
|
subject: subject,
|
||||||
body: body,
|
body: body,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
domain: transaction.rcpt_to[0].host,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
await MessageService.store(messageData);
|
await MessageService.store(messageData);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user