[GH-26715] Added Pagination Support for IncomingWebHooks (#27502)

* Added Pagination Support for IncomingWebHooks

* Incorporated feedback from reviews

* Removed trailing spaces

* Restored deleted server en.json entries, fixed order in webapp en.json

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
alexcekay
2024-08-09 22:44:22 +02:00
коммит произвёл GitHub
родитель 1cf6cf4f5c
Коммит 7232b5f002
35 изменённых файлов: 515 добавлений и 97 удалений

Просмотреть файл

@@ -352,15 +352,19 @@ func (s SqlWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.Out
return hook, nil
}
func (s SqlWebhookStore) AnalyticsIncomingCount(teamId string) (int64, error) {
func (s SqlWebhookStore) AnalyticsIncomingCount(teamID string, userID string) (int64, error) {
queryBuilder :=
s.getQueryBuilder().
Select("COUNT(*)").
From("IncomingWebhooks").
Where("DeleteAt = 0")
if teamId != "" {
queryBuilder = queryBuilder.Where("TeamId", teamId)
if teamID != "" {
queryBuilder = queryBuilder.Where(sq.Eq{"TeamId": teamID})
}
if userID != "" {
queryBuilder = queryBuilder.Where(sq.Eq{"UserId": userID})
}
queryString, args, err := queryBuilder.ToSql()