diff --git a/frontend/src/pages/tagged_resources_page.tsx b/frontend/src/pages/tagged_resources_page.tsx index af7b9ba..82d52c0 100644 --- a/frontend/src/pages/tagged_resources_page.tsx +++ b/frontend/src/pages/tagged_resources_page.tsx @@ -51,7 +51,7 @@ export default function TaggedResourcesPage() { }} /> } - {tag?.type &&

{tag.type}

} + {tag?.type &&

{tag.type}

}
{ (tag?.aliases ?? []).map((e) => { diff --git a/server/dao/tag.go b/server/dao/tag.go index 9b23f67..3db0904 100644 --- a/server/dao/tag.go +++ b/server/dao/tag.go @@ -64,6 +64,13 @@ func GetTagByName(name string) (model.Tag, error) { } func SetTagInfo(id uint, description string, aliasOf *uint, tagType string) error { + old, err := GetTagByID(id) + if err != nil { + return err + } + if aliasOf != nil && len(old.Aliases) > 0 { + return model.NewRequestError("Tag already has aliases, cannot set alias_of") + } t := model.Tag{Model: gorm.Model{ ID: id, }, Description: description, Type: tagType, AliasOf: aliasOf}