MM-39041: expose TotalsOnly option (#18767)
Sending a request to GetThreadsForUser for a TotalsOnly returns just the counts without any threads.
Этот коммит содержится в:
@@ -2989,6 +2989,7 @@ func getThreadsForUser(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
Unread: false,
|
Unread: false,
|
||||||
Extended: false,
|
Extended: false,
|
||||||
Deleted: false,
|
Deleted: false,
|
||||||
|
TotalsOnly: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
sinceString := r.URL.Query().Get("since")
|
sinceString := r.URL.Query().Get("since")
|
||||||
@@ -3012,10 +3013,12 @@ func getThreadsForUser(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
deletedStr := r.URL.Query().Get("deleted")
|
deletedStr := r.URL.Query().Get("deleted")
|
||||||
unreadStr := r.URL.Query().Get("unread")
|
unreadStr := r.URL.Query().Get("unread")
|
||||||
extendedStr := r.URL.Query().Get("extended")
|
extendedStr := r.URL.Query().Get("extended")
|
||||||
|
totalsOnlyStr := r.URL.Query().Get("totalsOnly")
|
||||||
|
|
||||||
options.Deleted, _ = strconv.ParseBool(deletedStr)
|
options.Deleted, _ = strconv.ParseBool(deletedStr)
|
||||||
options.Unread, _ = strconv.ParseBool(unreadStr)
|
options.Unread, _ = strconv.ParseBool(unreadStr)
|
||||||
options.Extended, _ = strconv.ParseBool(extendedStr)
|
options.Extended, _ = strconv.ParseBool(extendedStr)
|
||||||
|
options.TotalsOnly, _ = strconv.ParseBool(totalsOnlyStr)
|
||||||
|
|
||||||
threads, err := c.App.GetThreadsForUser(c.Params.UserId, c.Params.TeamId, options)
|
threads, err := c.App.GetThreadsForUser(c.Params.UserId, c.Params.TeamId, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user