mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
Improve search
This commit is contained in:
@@ -9,6 +9,10 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
maxTagLength = 20
|
||||
)
|
||||
|
||||
func init() {
|
||||
// Start a goroutine to delete unused tags every hour
|
||||
go func() {
|
||||
@@ -25,6 +29,9 @@ func init() {
|
||||
}
|
||||
|
||||
func CreateTag(uid uint, name string) (*model.TagView, error) {
|
||||
if len([]rune(name)) > maxTagLength {
|
||||
return nil, model.NewRequestError("Tag name too long")
|
||||
}
|
||||
canUpload, err := checkUserCanUpload(uid)
|
||||
if err != nil {
|
||||
log.Error("Error checking user permissions:", err)
|
||||
|
Reference in New Issue
Block a user