Order history by changed_at, published_at
When a bunch of entries are marked as read at once, they should have the same `changed_at`; fall back to sorting them chronologically by publication date.
This commit is contained in:
parent
1aeb1b20da
commit
7d1609bd93
1 changed files with 1 additions and 2 deletions
|
@ -25,8 +25,7 @@ func (h *handler) showHistoryPage(w http.ResponseWriter, r *http.Request) {
|
||||||
offset := request.QueryIntParam(r, "offset", 0)
|
offset := request.QueryIntParam(r, "offset", 0)
|
||||||
builder := h.store.NewEntryQueryBuilder(user.ID)
|
builder := h.store.NewEntryQueryBuilder(user.ID)
|
||||||
builder.WithStatus(model.EntryStatusRead)
|
builder.WithStatus(model.EntryStatusRead)
|
||||||
builder.WithOrder("changed_at")
|
builder.WithOrder("changed_at DESC, published_at DESC")
|
||||||
builder.WithDirection("desc")
|
|
||||||
builder.WithOffset(offset)
|
builder.WithOffset(offset)
|
||||||
builder.WithLimit(user.EntriesPerPage)
|
builder.WithLimit(user.EntriesPerPage)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue