Skip to content

Commit

Permalink
fix: only allow at most 10 tags
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Oct 10, 2024
1 parent 10ec957 commit cc05cf2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/req/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func (v *SubjectEpisodeCollectionPatch) Validate() error {
}

if v.Tags != nil {
if len(v.Tags) > 10 {
return res.BadRequest("最多允许 10 个标签")
}

v.Tags = lo.Map(v.Tags, func(item string, index int) string {
return norm.NFKC.String(item)
})
Expand Down

0 comments on commit cc05cf2

Please sign in to comment.