[MM-56031] Add DeleteSidebarCategory method and channel category API tests (#29161)

* Add DeleteSidebarCategory method and channel category API tests

* Add test to verify channels move to default categories when custom category is deleted

* rename channel category tests and remove duplicate context

* TestNotifications fix

---------

Co-authored-by: Fume <contact@fumedev.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
fume4mattermost
2024-12-17 00:29:43 +03:00
коммит произвёл GitHub
родитель 93ed5c445a
Коммит 4a5994906c
2 изменённых файлов: 716 добавлений и 0 удалений

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

@@ -8306,6 +8306,17 @@ func (c *Client4) UpdateSidebarCategoryForTeamForUser(ctx context.Context, userI
return cat, BuildResponse(r), nil
}
// DeleteSidebarCategoryForTeamForUser deletes a sidebar category for a user in a team.
func (c *Client4) DeleteSidebarCategoryForTeamForUser(ctx context.Context, userId string, teamId string, categoryId string) (*Response, error) {
url := fmt.Sprintf("%s/%s", c.userCategoryRoute(userId, teamId), categoryId)
r, err := c.DoAPIDelete(ctx, url)
if err != nil {
return BuildResponse(r), err
}
defer closeBody(r)
return BuildResponse(r), nil
}
// CheckIntegrity performs a database integrity check.
func (c *Client4) CheckIntegrity(ctx context.Context) ([]IntegrityCheckResult, *Response, error) {
r, err := c.DoAPIPost(ctx, "/integrity", "")