diff options
| author | julian laplace <julescarbon@gmail.com> | 2024-03-12 16:49:56 +0100 |
|---|---|---|
| committer | julian laplace <julescarbon@gmail.com> | 2024-03-12 16:49:56 +0100 |
| commit | e09c383844b11633c121c5d61c73ca30f69b72cd (patch) | |
| tree | 52d082b50b724300ae6a76192d4fea5e3463fb5b /bucky/db | |
| parent | 011aca6ceab1ff26e7feb0f3a72329585e19af72 (diff) | |
fix rm
Diffstat (limited to 'bucky/db')
| -rw-r--r-- | bucky/db/index.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/bucky/db/index.js b/bucky/db/index.js index 57b9c1c..6c58101 100644 --- a/bucky/db/index.js +++ b/bucky/db/index.js @@ -162,10 +162,10 @@ db.getHootstreamThreads = ({ files, comments }) => new Set( [...comments, ...files] .map((item) => item?.thread) - .filter((item) => !!item) - ) - ) - ) + .filter((item) => !!item), + ), + ), + ), ).fetchAll(); db.getHootstreamAllCommentsForThread = (thread) => Comment.where((builder) => builder.where("thread", thread.id)).fetchAll(); @@ -176,21 +176,21 @@ db.getHootstreamSomeFilesForThreads = (threads, count = 1) => Promise.all( threads.map((thread) => File.query((builder) => - builder.where("thread", thread.id).orderBy("date", "desc").limit(count) - ).fetchAll() - ) + builder.where("thread", thread.id).orderBy("date", "desc").limit(count), + ).fetchAll(), + ), ).then((results) => - results.reduce((list, result) => list.concat(Array.from(result)), []) + results.reduce((list, result) => list.concat(Array.from(result)), []), ); db.getHootstreamSomeCommentsForThreads = (threads, count = 1) => Promise.all( threads.map((thread) => Comment.query((builder) => - builder.where("thread", thread.id).orderBy("date", "desc").limit(count) - ).fetchAll() - ) + builder.where("thread", thread.id).orderBy("date", "desc").limit(count), + ).fetchAll(), + ), ).then((results) => - results.reduce((list, result) => list.concat(Array.from(result)), []) + results.reduce((list, result) => list.concat(Array.from(result)), []), ); /* THREADS */ @@ -388,7 +388,7 @@ db.destroyFiles = function (files) { var filePromises = files.map((file) => { return file.destroy(); }); - return Promise.all(rmPromises.join(filePromises)); + return rmPromises.join(filePromises); }; /* COMMENTS */ @@ -525,7 +525,7 @@ db.getMessages = function (username, box, limit, offset) { "recipient", "date", "subject", - knex.raw("CHAR_LENGTH(body) as size") + knex.raw("CHAR_LENGTH(body) as size"), ) .where("mbox", "=", mbox) .orderBy("id", "desc"); |
