BREAKING CHANGE: V2 of thr SDK #12
@ -97,7 +97,7 @@ func CreateTagAlias(ctx context.Context, db *gorm.DB, tagAliasName models.Anthro
|
||||
return &otterError.EntityValidationFailed{Reason: "tagAliasName cannot be empty"}
|
||||
}
|
||||
if tagID == "" {
|
||||
return &otterError.EntityValidationFailed{Reason: "tagID cannot be empty"}
|
||||
return &otterError.EntityValidationFailed{Reason: otterError.AnthroveTagIDEmpty}
|
||||
}
|
||||
|
||||
result := db.WithContext(ctx).Create(&models.TagAlias{
|
||||
@ -143,7 +143,7 @@ func GetAllTagAliasByTag(ctx context.Context, db *gorm.DB, tagID models.Anthrove
|
||||
var tagAliases []models.TagAlias
|
||||
|
||||
if tagID == "" {
|
||||
return nil, &otterError.EntityValidationFailed{Reason: "tagID cannot be empty"}
|
||||
return nil, &otterError.EntityValidationFailed{Reason: otterError.AnthroveTagIDEmpty}
|
||||
}
|
||||
|
||||
result := db.WithContext(ctx).Where("tag_id = ?", tagID).Find(&tagAliases)
|
||||
@ -191,7 +191,7 @@ func CreateTagGroup(ctx context.Context, db *gorm.DB, tagGroupName models.Anthro
|
||||
return &otterError.EntityValidationFailed{Reason: "tagGroupName cannot be empty"}
|
||||
}
|
||||
if tagID == "" {
|
||||
return &otterError.EntityValidationFailed{Reason: "tagID cannot be empty"}
|
||||
return &otterError.EntityValidationFailed{Reason: otterError.AnthroveTagIDEmpty}
|
||||
}
|
||||
|
||||
result := db.WithContext(ctx).Create(&models.TagGroup{
|
||||
@ -237,7 +237,7 @@ func GetAllTagGroupByTag(ctx context.Context, db *gorm.DB, tagID models.Anthrove
|
||||
var tagGroups []models.TagGroup
|
||||
|
||||
if tagID == "" {
|
||||
return nil, &otterError.EntityValidationFailed{Reason: "tagID cannot be empty"}
|
||||
return nil, &otterError.EntityValidationFailed{Reason: otterError.AnthroveTagIDEmpty}
|
||||
}
|
||||
|
||||
result := db.WithContext(ctx).Where("tag_id = ?", tagID).Find(&tagGroups)
|
||||
|
@ -7,6 +7,7 @@ const (
|
||||
AnthroveUserIDToShort = "anthrovePostID needs to be 25 characters long"
|
||||
AnthroveSourceIDEmpty = "anthroveSourceID cannot be empty"
|
||||
AnthroveSourceIDToShort = "anthroveSourceID needs to be 25 characters long"
|
||||
AnthroveTagIDEmpty = "tagID cannot be empty"
|
||||
)
|
||||
|
||||
type EntityValidationFailed struct {
|
||||
|
Reference in New Issue
Block a user