Skip to content

Commit

Permalink
feat(ui): edit article
Browse files Browse the repository at this point in the history
  • Loading branch information
ncarlier committed Oct 30, 2022
1 parent 836d101 commit e5c252f
Show file tree
Hide file tree
Showing 26 changed files with 338 additions and 18,767 deletions.
4 changes: 2 additions & 2 deletions pkg/service/articles_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ func addLoggerContextForUpdateArticle(logger *zerolog.Event, form model.ArticleU
func validateArticleUpdateForm(form model.ArticleUpdateForm) error {
validations := new(helper.FieldsValidator)
validations.Validate("stars", func() bool {
return form.Stars == nil || (*form.Stars >= 0 && *form.Stars <= 5)
return form.Stars == nil || *form.Stars <= 5
})
validations.Validate("title", func() bool {
if form.Title != nil {
l := len(strings.TrimSpace(*form.Title))
return l >= 0 && l <= 128
return l > 0 && l <= 256
}
return true
})
Expand Down
Loading

0 comments on commit e5c252f

Please sign in to comment.