Skip to content

Commit

Permalink
Channel banner sql migrations (mattermost#30274)
Browse files Browse the repository at this point in the history
* Adde MySQL and Postgres migrations

* Replaced select * with column names

* removed all * from channel SQL store

* cleanup

* Fixed a duplicate column

* cleanup

* Added migrations and store support

* WIP

* used channelname slice in a missed place

* Handled patch

* Added app level tests

* Added API layer tests

* Added API layer tests

* WIP

* converted to query builder

* cleanupo

* added not null and default constraints

* Fixed test

* fixed file name

* review fixes

* review fixes

* updated migration file

* fixed text

* Review fixes
  • Loading branch information
harshilsharma63 authored Feb 25, 2025
1 parent 6df8726 commit 6e738f4
Show file tree
Hide file tree
Showing 12 changed files with 666 additions and 169 deletions.
5 changes: 5 additions & 0 deletions server/channels/api4/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ func patchChannel(c *Context, w http.ResponseWriter, r *http.Request) {
}
}

if patch.BannerInfo != nil && (originalOldChannel.Type != model.ChannelTypeOpen && originalOldChannel.Type != model.ChannelTypePrivate) {
c.Err = model.NewAppError("patchChannel", "api.channel.update_channel.banner_info.channel_type.not_allowed", nil, "", http.StatusBadRequest)
return
}

rchannel, appErr := c.App.PatchChannel(c.AppContext, oldChannel, patch, c.AppContext.Session().UserId)
if appErr != nil {
c.Err = appErr
Expand Down
Loading

0 comments on commit 6e738f4

Please sign in to comment.