add file uploads

This commit is contained in:
biglyderv 2025-02-26 20:17:33 -05:00
parent 93027bfd09
commit 2c480909ee
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
6 changed files with 42 additions and 7 deletions

8
lib.js
View file

@ -9,6 +9,11 @@ function apiStat(res, next, message, success = false, redirect = '/') {
next();
}
function splitUp(content) {
let out = content.split('\n').map(x => x.split('::'));
return out;
}
async function replyIterator(replies, db) {
for (let reply of replies) {
if (reply.childType == 'hub') {
@ -31,6 +36,9 @@ async function replyIterator(replies, db) {
reply.comment.type = reply.childType;
//reply.comment.id = reply.childId;
}
for (let reply of replies) {
reply.comment.content = splitUp(reply.comment.content)
}
return replies;
}