perf: move attachments to post hash

This commit is contained in:
Barış Soner Uşaklı
2024-06-13 19:49:04 -04:00
parent f76a586328
commit 291bf7db41
2 changed files with 21 additions and 18 deletions

View File

@@ -67,5 +67,8 @@ function modifyPost(post, fields) {
if (post.hasOwnProperty('edited')) {
post.editedISO = post.edited !== 0 ? utils.toISOString(post.edited) : '';
}
if (!fields.length || fields.includes('attachments')) {
post.attachments = (post.attachments || '').split(',').filter(Boolean);
}
}
}