blah.
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 29s

This commit is contained in:
Flummi
2024-06-28 18:33:12 +02:00
parent 6852ac40d1
commit 38c4abae3c
4 changed files with 60 additions and 5 deletions

View File

@ -0,0 +1,26 @@
import db from "../../inc/sql.mjs";
import cfg from "../../inc/config.mjs";
import f0cklib from "../routeinc/f0cklib.mjs";
export default (router, tpl) => {
router.get(/^\/picdump$/, async (req, res) => {
const dump = await db`
SELECT *
FROM items
WHERE (
to_timestamp(stamp) >= date_trunc('week', CURRENT_TIMESTAMP - interval '1 week') AND
to_timestamp(stamp) < date_trunc('week', CURRENT_TIMESTAMP)
) AND
mime LIKE 'image/%'
ORDER BY stamp DESC
`;
res.reply({
body: tpl.render('picdump', {
dump,
tmp: null
}, req)
});
});
return router;
};