mirror of
https://github.com/GRFreire/nthmail.git
synced 2026-01-09 04:49:39 +00:00
inbox: show mails in descending order
This commit is contained in:
parent
9c600d863e
commit
661922ce35
@ -111,7 +111,20 @@ func (sr ServerResouces) handleInbox(res http.ResponseWriter, req *http.Request)
|
||||
}
|
||||
defer tx.Commit()
|
||||
|
||||
stmt, err := tx.Prepare("SELECT mails.id, mails.arrived_at, mails.rcpt_addr, mails.from_addr, mails.subject FROM mails WHERE mails.rcpt_addr = ?")
|
||||
stmt, err := tx.Prepare(
|
||||
"SELECT " +
|
||||
"mails.id, " +
|
||||
"mails.arrived_at, " +
|
||||
"mails.rcpt_addr, " +
|
||||
"mails.from_addr, " +
|
||||
"mails.subject " +
|
||||
"FROM " +
|
||||
"mails " +
|
||||
"WHERE " +
|
||||
"mails.rcpt_addr = ? " +
|
||||
"ORDER BY " +
|
||||
"mails.arrived_at DESC",
|
||||
)
|
||||
if err != nil {
|
||||
res.WriteHeader(500)
|
||||
res.Write([]byte("internal server error"))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user