ordering
ci / docker_image (push) Successful in 2m17s
ci / deploy (push) Successful in 26s

This commit is contained in:
2026-06-30 13:05:01 -05:00
parent 6f375cd990
commit 5cce7928ec
2 changed files with 5 additions and 4 deletions
@@ -40,7 +40,7 @@
</script>
<button type="button"
<div
class="text-left h-full bg-card text-card-foreground flex flex-col gap-2 rounded-xl border shadow-sm max-w-sm overflow-hidden min-w-2xs" onclick={() => {claimCallback(item)}}>
{#if item.image}
<img src="https://fbla26.marinodev.com/uploads/{item.id}.jpg" class="object-cover min-h-48 max-h-48"
@@ -149,5 +149,5 @@
</div>
</button>
</div>
+3 -2
View File
@@ -35,7 +35,8 @@ export const load: PageServerLoad = async ({ url, locals }) => {
WHERE im.thread_id = t.id
) m ON TRUE
${searchQuery ? sql`WHERE word_similarity(${searchQuery}, i.description) > 0.3` : sql``}
GROUP BY i.id;
GROUP BY i.id
ORDER BY t.found_date DESC;
`;
items.forEach((item) =>
item.threads?.forEach((thread) => (thread.createdAt = new Date(thread.createdAt)))
@@ -110,7 +111,7 @@ export const load: PageServerLoad = async ({ url, locals }) => {
// Not logged in or fallback: simple item list (no threads)
let items: Item[];
if (!searchQuery) {
items = await sql`SELECT * FROM items;`;
items = await sql`SELECT * FROM items ORDER BY found_date DESC;`;
} else {
items = await sql`
SELECT * FROM items