mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-25659] ability to permanent delete channel through client (#15202)
Summary
Ability to permanent delete channel through client
Ticket Link
https://mattermost.atlassian.net/browse/MM-25659
This commit is contained in:
@@ -2562,6 +2562,16 @@ func (c *Client4) DeleteChannel(channelId string) (bool, *Response) {
|
||||
return CheckStatusOK(r), BuildResponse(r)
|
||||
}
|
||||
|
||||
// PermanentDeleteChannel deletes a channel based on the provided channel id string.
|
||||
func (c *Client4) PermanentDeleteChannel(channelId string) (bool, *Response) {
|
||||
r, err := c.DoApiDelete(c.GetChannelRoute(channelId) + "?permanent=" + c.boolString(true))
|
||||
if err != nil {
|
||||
return false, BuildErrorResponse(r, err)
|
||||
}
|
||||
defer closeBody(r)
|
||||
return CheckStatusOK(r), BuildResponse(r)
|
||||
}
|
||||
|
||||
// MoveChannel moves the channel to the destination team.
|
||||
func (c *Client4) MoveChannel(channelId, teamId string, force bool) (*Channel, *Response) {
|
||||
requestBody := map[string]interface{}{
|
||||
|
||||
@@ -329,6 +329,7 @@ type ServiceSettings struct {
|
||||
DEPRECATED_DO_NOT_USE_ImageProxyOptions *string `json:"ImageProxyOptions" mapstructure:"ImageProxyOptions"` // This field is deprecated and must not be used.
|
||||
EnableAPITeamDeletion *bool
|
||||
EnableAPIUserDeletion *bool
|
||||
EnableAPIChannelDeletion *bool
|
||||
ExperimentalEnableHardenedMode *bool
|
||||
DisableLegacyMFA *bool `restricted:"true"`
|
||||
ExperimentalStrictCSRFEnforcement *bool `restricted:"true"`
|
||||
@@ -705,6 +706,10 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
|
||||
s.EnableAPIUserDeletion = NewBool(false)
|
||||
}
|
||||
|
||||
if s.EnableAPIChannelDeletion == nil {
|
||||
s.EnableAPIChannelDeletion = NewBool(false)
|
||||
}
|
||||
|
||||
if s.ExperimentalEnableHardenedMode == nil {
|
||||
s.ExperimentalEnableHardenedMode = NewBool(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user