mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
Add tags page.
This commit is contained in:
@@ -82,3 +82,13 @@ func SetTagInfo(id uint, description string, aliasOf *uint, tagType string) erro
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ListTags retrieves all tags from the database.
|
||||
// Only returns the ID, name, and type of each tag.
|
||||
func ListTags() ([]model.Tag, error) {
|
||||
var tags []model.Tag
|
||||
if err := db.Select("id", "name", "type").Where("alias_of is null").Find(&tags).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return tags, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user