[MM-56073] MMCTL delete post command (#27539)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
@@ -4021,6 +4021,16 @@ func (c *Client4) DeletePost(ctx context.Context, postId string) (*Response, err
|
||||
return BuildResponse(r), nil
|
||||
}
|
||||
|
||||
// PermanentDeletePost permanently deletes a post and its files from the provided post id string.
|
||||
func (c *Client4) PermanentDeletePost(ctx context.Context, postId string) (*Response, error) {
|
||||
r, err := c.DoAPIDelete(ctx, c.postRoute(postId)+"?permanent="+c.boolString(true))
|
||||
if err != nil {
|
||||
return BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
return BuildResponse(r), nil
|
||||
}
|
||||
|
||||
// GetPostThread gets a post with all the other posts in the same thread.
|
||||
func (c *Client4) GetPostThread(ctx context.Context, postId string, etag string, collapsedThreads bool) (*PostList, *Response, error) {
|
||||
url := c.postRoute(postId) + "/thread"
|
||||
|
||||
@@ -387,6 +387,7 @@ type ServiceSettings struct {
|
||||
EnableAPITeamDeletion *bool
|
||||
EnableAPITriggerAdminNotifications *bool
|
||||
EnableAPIUserDeletion *bool
|
||||
EnableAPIPostDeletion *bool
|
||||
EnableDesktopLandingPage *bool
|
||||
ExperimentalEnableHardenedMode *bool `access:"experimental_features"`
|
||||
ExperimentalStrictCSRFEnforcement *bool `access:"experimental_features,write_restrictable,cloud_restrictable"`
|
||||
@@ -806,6 +807,10 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
|
||||
s.EnableAPIUserDeletion = NewPointer(false)
|
||||
}
|
||||
|
||||
if s.EnableAPIPostDeletion == nil {
|
||||
s.EnableAPIPostDeletion = NewBool(false)
|
||||
}
|
||||
|
||||
if s.EnableAPIChannelDeletion == nil {
|
||||
s.EnableAPIChannelDeletion = NewPointer(false)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user