Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix(siteinfo): remove theme config in interface

LinkinStar21e402cb8ad2
diff --git a/internal/schema/siteinfo_schema.go b/internal/schema/siteinfo_schema.go
index f13b1c83..16ccd211 100644
--- a/internal/schema/siteinfo_schema.go
+++ b/internal/schema/siteinfo_schema.go
@@ -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"`
}
diff --git a/internal/service/siteinfo/siteinfo_service.go b/internal/service/siteinfo/siteinfo_service.go
index afbd7edd..549ef6be 100644
--- a/internal/service/siteinfo/siteinfo_service.go
+++ b/internal/service/siteinfo/siteinfo_service.go
@@ -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)