Implement file upload for replies

This commit is contained in:
Dominic Ferrando
2025-04-18 15:41:29 -04:00
parent 00c8057b5b
commit a80a7a4dba
6 changed files with 188 additions and 130 deletions
+2 -2
View File
@@ -118,8 +118,8 @@ func PutThread(db *sql.DB, boardSlug string, subject string, body string, mediaP
return nil
}
func PutPost(db *sql.DB, threadId int, body string) error {
_, err := db.Exec(`INSERT INTO posts (thread_id, body) VALUES (?, ?)`, threadId, body)
func PutPost(db *sql.DB, threadId int, body string, mediaPath string) error {
_, err := db.Exec(`INSERT INTO posts (thread_id, body, media_path) VALUES (?, ?, ?)`, threadId, body, mediaPath)
if err != nil {
return err
}