fix limit being hard coded to 20

This commit is contained in:
Lera Elvoé 2025-05-19 09:47:55 +03:00
parent 6181701da6
commit 70a780909a
Signed by: yagich
SSH Key Fingerprint: SHA256:6xjGb6uA7lAVcULa7byPEN//rQ0wPoG+UzYVMfZnbvc

View File

@ -85,8 +85,8 @@ app:get("thread", "/:slug", function(self)
posts.thread_id = ?
ORDER BY
posts.created_at ASC
LIMIT 20 OFFSET ?
]], thread.id, (self.page - 1) * posts_per_page)
LIMIT ? OFFSET ?
]], thread.id, posts_per_page, (self.page - 1) * posts_per_page)
self.topic = Topics:find(thread.topic_id)
self.user = util.get_logged_in_user_or_transient(self)
self.posts = posts