Merge branch 'feat/tag/search' into 'main'

fix: fix update site general info incorrect request process

See merge request opensource/answer!38
This commit is contained in:
linkinstar 2022-09-30 07:43:16 +00:00
commit 704e79e0c0
1 changed files with 6 additions and 2 deletions

View File

@ -56,7 +56,9 @@ func (sc *SiteInfoController) GetInterface(ctx *gin.Context) {
// @Router /answer/admin/api/siteinfo/general [put]
func (sc *SiteInfoController) UpdateGeneral(ctx *gin.Context) {
req := schema.SiteGeneralReq{}
handler.BindAndCheck(ctx, &req)
if handler.BindAndCheck(ctx, &req) {
return
}
err := sc.siteInfoService.SaveSiteGeneral(ctx, req)
handler.HandleResponse(ctx, err, nil)
}
@ -72,7 +74,9 @@ func (sc *SiteInfoController) UpdateGeneral(ctx *gin.Context) {
// @Router /answer/admin/api/siteinfo/interface [put]
func (sc *SiteInfoController) UpdateInterface(ctx *gin.Context) {
req := schema.SiteInterfaceReq{}
handler.BindAndCheck(ctx, &req)
if handler.BindAndCheck(ctx, &req) {
return
}
err := sc.siteInfoService.SaveSiteInterface(ctx, req)
handler.HandleResponse(ctx, err, nil)
}