GH-27059: Rewrite error messages about msg length (#29252)
Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f1d5884532
Коммит
8b86e1276e
@@ -28,7 +28,8 @@ type Draft struct {
|
||||
|
||||
func (o *Draft) IsValid(maxDraftSize int) *AppError {
|
||||
if utf8.RuneCountInString(o.Message) > maxDraftSize {
|
||||
return NewAppError("Drafts.IsValid", "model.draft.is_valid.msg.app_error", nil, "channelid="+o.ChannelId, http.StatusBadRequest)
|
||||
return NewAppError("Drafts.IsValid", "model.draft.is_valid.message_length.app_error",
|
||||
map[string]any{"Length": utf8.RuneCountInString(o.Message), "MaxLength": maxDraftSize}, "channelid="+o.ChannelId, http.StatusBadRequest)
|
||||
}
|
||||
|
||||
return o.BaseIsValid()
|
||||
|
||||
Ссылка в новой задаче
Block a user