Use getEntryIDs instead of getEntries in Fever API
This commit is contained in:
parent
8304666261
commit
f7273e5cdf
1 changed files with 3 additions and 3 deletions
|
@ -325,15 +325,15 @@ func (h *handler) handleUnreadItems(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
builder := h.store.NewEntryQueryBuilder(userID)
|
builder := h.store.NewEntryQueryBuilder(userID)
|
||||||
builder.WithStatus(model.EntryStatusUnread)
|
builder.WithStatus(model.EntryStatusUnread)
|
||||||
entries, err := builder.GetEntries()
|
rawEntryIDs, err := builder.GetEntryIDs()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
json.ServerError(w, r, err)
|
json.ServerError(w, r, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var itemIDs []string
|
var itemIDs []string
|
||||||
for _, entry := range entries {
|
for _, entryID := range rawEntryIDs {
|
||||||
itemIDs = append(itemIDs, strconv.FormatInt(entry.ID, 10))
|
itemIDs = append(itemIDs, strconv.FormatInt(entryID, 10))
|
||||||
}
|
}
|
||||||
|
|
||||||
var result unreadResponse
|
var result unreadResponse
|
||||||
|
|
Loading…
Add table
Reference in a new issue