mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
Add Quick Add Tag functionality and improve tag management in Edit and Publish pages
This commit is contained in:
@@ -16,6 +16,15 @@ func CreateTag(tag string) (model.Tag, error) {
|
||||
return t, nil
|
||||
}
|
||||
|
||||
func CreateTagWithType(tag string, tagType string) (model.Tag, error) {
|
||||
// Create a new tag with a specific type in the database
|
||||
t := model.Tag{Name: tag, Type: tagType}
|
||||
if err := db.Create(&t).Error; err != nil {
|
||||
return model.Tag{}, err
|
||||
}
|
||||
return t, nil
|
||||
}
|
||||
|
||||
func SearchTag(keyword string, mainTag bool) ([]model.Tag, error) {
|
||||
// Search for a tag by its name in the database
|
||||
var t []model.Tag
|
||||
|
Reference in New Issue
Block a user