- Update debugBuilder to inspect objects instead of stringify
- Moved tthe debug entry for saving post to after the post is validated
This commit is contained in:
Logan Cusano
2023-06-18 14:49:15 -04:00
parent 79d2ca1887
commit 24faa5279d
3 changed files with 14 additions and 12 deletions

View File

@@ -480,11 +480,11 @@ exports.PostStorage = class PostStorage extends Storage {
}
savePost(_postObject, callback){
const tempCreationDate = returnMysqlTime();
log.DEBUG("Saving Post Object:", _postObject);
const tempCreationDate = returnMysqlTime();
if (!_postObject?.postId || !_postObject?.link) {
return callback(new Error("Post object malformed, check the object before saving it", _postObject), undefined)
}
log.DEBUG("Saving Post:", _postObject);
if (_postObject.link.length > 250) _postObject.link = _postObject.link.substring(0, 250);