MM-39041: expose TotalsOnly option (#18767)
Sending a request to GetThreadsForUser for a TotalsOnly returns just the counts without any threads.
Этот коммит содержится в:
17
api4/user.go
17
api4/user.go
@@ -2982,13 +2982,14 @@ func getThreadsForUser(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
options := model.GetUserThreadsOpts{
|
||||
Since: 0,
|
||||
Before: "",
|
||||
After: "",
|
||||
PageSize: uint64(c.Params.PerPage),
|
||||
Unread: false,
|
||||
Extended: false,
|
||||
Deleted: false,
|
||||
Since: 0,
|
||||
Before: "",
|
||||
After: "",
|
||||
PageSize: uint64(c.Params.PerPage),
|
||||
Unread: false,
|
||||
Extended: false,
|
||||
Deleted: false,
|
||||
TotalsOnly: false,
|
||||
}
|
||||
|
||||
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")
|
||||
unreadStr := r.URL.Query().Get("unread")
|
||||
extendedStr := r.URL.Query().Get("extended")
|
||||
totalsOnlyStr := r.URL.Query().Get("totalsOnly")
|
||||
|
||||
options.Deleted, _ = strconv.ParseBool(deletedStr)
|
||||
options.Unread, _ = strconv.ParseBool(unreadStr)
|
||||
options.Extended, _ = strconv.ParseBool(extendedStr)
|
||||
options.TotalsOnly, _ = strconv.ParseBool(totalsOnlyStr)
|
||||
|
||||
threads, err := c.App.GetThreadsForUser(c.Params.UserId, c.Params.TeamId, options)
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user