mirror of https://gitee.com/answerdev/answer.git
fix(siteinfo): remove theme config in interface
This commit is contained in:
parent
e6069d8475
commit
21e402cb8a
|
@ -36,7 +36,6 @@ func (r *SiteGeneralReq) FormatSiteUrl() {
|
|||
|
||||
// SiteInterfaceReq site interface request
|
||||
type SiteInterfaceReq struct {
|
||||
Theme string `validate:"required,gt=1,lte=128" form:"theme" json:"theme"`
|
||||
Language string `validate:"required,gt=1,lte=128" form:"language" json:"language"`
|
||||
TimeZone string `validate:"required,gt=1,lte=128" form:"time_zone" json:"time_zone"`
|
||||
}
|
||||
|
|
|
@ -114,23 +114,10 @@ func (s *SiteInfoService) SaveSiteGeneral(ctx context.Context, req schema.SiteGe
|
|||
|
||||
func (s *SiteInfoService) SaveSiteInterface(ctx context.Context, req schema.SiteInterfaceReq) (err error) {
|
||||
var (
|
||||
siteType = "interface"
|
||||
themeExist bool
|
||||
content []byte
|
||||
siteType = "interface"
|
||||
content []byte
|
||||
)
|
||||
|
||||
// check theme
|
||||
for _, theme := range schema.GetThemeOptions {
|
||||
if theme.Value == req.Theme {
|
||||
themeExist = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !themeExist {
|
||||
err = errors.BadRequest(reason.ThemeNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
// check language
|
||||
if !translator.CheckLanguageIsValid(req.Language) {
|
||||
err = errors.BadRequest(reason.LangNotFound)
|
||||
|
|
Loading…
Reference in New Issue