Set bumped_at on thread when post is created

This commit is contained in:
Dominic Ferrando
2025-04-21 13:09:20 -04:00
parent 151b740ee9
commit 997d65707c
+4
View File
@@ -176,7 +176,11 @@ func PutPost(db Queryer, boardSlug string, threadId int, body string, mediaPath
_, err := db.Exec(` _, err := db.Exec(`
INSERT INTO posts (thread_id, body, media_path, ip_hash, number) INSERT INTO posts (thread_id, body, media_path, ip_hash, number)
VALUES (?, ?, ?, ?, ?)`, threadId, body, mediaPath, ip_hash, newPostNumber) VALUES (?, ?, ?, ?, ?)`, threadId, body, mediaPath, ip_hash, newPostNumber)
if err != nil {
return err
}
_, err = db.Exec(`UPDATE threads SET bumped_at = CURRENT_TIMESTAMP where id = ?`, threadId)
if err != nil { if err != nil {
return err return err
} }