Compare commits
No commits in common. "755aea20aa48a6eec16a0702d56811893815c44f" and "d9574ace65dc8e3f16646b08128d4516ae3634bd" have entirely different histories.
755aea20aa
...
d9574ace65
@ -183,7 +183,7 @@ func DeleteUserFavorite(ctx context.Context, id models.UserFavoriteID) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(id) != 25 {
|
if len(id) != 25 {
|
||||||
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.UserFavoriteIsWrongLength})
|
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.UserFavoriteIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
result := client.WithContext(ctx).Delete(&userFavorite, id)
|
result := client.WithContext(ctx).Delete(&userFavorite, id)
|
||||||
|
@ -147,7 +147,7 @@ func DeletePool(ctx context.Context, id models.PoolID) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(id) != 25 {
|
if len(id) != 25 {
|
||||||
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsWrongLength})
|
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
result := client.WithContext(ctx).Delete(&pool, "id = ?", id)
|
result := client.WithContext(ctx).Delete(&pool, "id = ?", id)
|
||||||
|
@ -36,8 +36,8 @@ func CreatePoolPost(ctx context.Context, poolID models.PoolID, postID models.Pos
|
|||||||
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
|
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(poolID) == 0 {
|
if len(poolID) != 25 {
|
||||||
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsWrongLength})
|
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
if postID == "" {
|
if postID == "" {
|
||||||
@ -45,7 +45,7 @@ func CreatePoolPost(ctx context.Context, poolID models.PoolID, postID models.Pos
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(postID) != 25 {
|
if len(postID) != 25 {
|
||||||
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDIsWrongLength})
|
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
poolPost := models.PoolPost{
|
poolPost := models.PoolPost{
|
||||||
@ -92,8 +92,8 @@ func DeletePoolPost(ctx context.Context, poolID models.PoolID, postID models.Pos
|
|||||||
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
|
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(poolID) == 0 {
|
if len(poolID) != 25 {
|
||||||
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsWrongLength})
|
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
if postID == "" {
|
if postID == "" {
|
||||||
@ -101,7 +101,7 @@ func DeletePoolPost(ctx context.Context, poolID models.PoolID, postID models.Pos
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(postID) != 25 {
|
if len(postID) != 25 {
|
||||||
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDIsWrongLength})
|
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
result := client.WithContext(ctx).Delete(&poolPost, "pool_id = ? AND post_id = ?", poolID, postID)
|
result := client.WithContext(ctx).Delete(&poolPost, "pool_id = ? AND post_id = ?", poolID, postID)
|
||||||
|
@ -37,7 +37,7 @@ func CreatePoolReference(ctx context.Context, poolID models.PoolID, sourceID mod
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(poolID) != 25 {
|
if len(poolID) != 25 {
|
||||||
return models.PoolReference{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsWrongLength})
|
return models.PoolReference{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
if sourceID == "" {
|
if sourceID == "" {
|
||||||
@ -45,7 +45,7 @@ func CreatePoolReference(ctx context.Context, poolID models.PoolID, sourceID mod
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(sourceID) != 25 {
|
if len(sourceID) != 25 {
|
||||||
return models.PoolReference{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDIsWrongLength})
|
return models.PoolReference{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
if url == "" {
|
if url == "" {
|
||||||
@ -96,8 +96,8 @@ func DeletePoolReference(ctx context.Context, poolID models.PoolID, sourceID mod
|
|||||||
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
|
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(poolID) == 0 {
|
if len(poolID) != 25 {
|
||||||
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDIsWrongLength})
|
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
if sourceID == "" {
|
if sourceID == "" {
|
||||||
@ -105,7 +105,7 @@ func DeletePoolReference(ctx context.Context, poolID models.PoolID, sourceID mod
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(sourceID) != 25 {
|
if len(sourceID) != 25 {
|
||||||
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDIsWrongLength})
|
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
result := client.WithContext(ctx).Delete(&poolReference, "pool_id = ? AND source_id = ?", poolID, sourceID)
|
result := client.WithContext(ctx).Delete(&poolReference, "pool_id = ? AND source_id = ?", poolID, sourceID)
|
||||||
|
@ -191,7 +191,7 @@ func DeletePost(ctx context.Context, id models.PostID) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(id) != 25 {
|
if len(id) != 25 {
|
||||||
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDIsWrongLength})
|
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
result := client.WithContext(ctx).Delete(&userFavorite, "id = ?", id)
|
result := client.WithContext(ctx).Delete(&userFavorite, "id = ?", id)
|
||||||
|
@ -155,7 +155,7 @@ func GetSourceByID(ctx context.Context, id models.SourceID) (models.Source, erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(id) != 25 {
|
if len(id) != 25 {
|
||||||
return models.Source{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDIsWrongLength})
|
return models.Source{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
result := client.WithContext(ctx).First(&source, "id = ?", id)
|
result := client.WithContext(ctx).First(&source, "id = ?", id)
|
||||||
@ -231,7 +231,7 @@ func DeleteSource(ctx context.Context, id models.SourceID) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(id) != 25 {
|
if len(id) != 25 {
|
||||||
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDIsWrongLength})
|
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
result := client.WithContext(ctx).Delete(&source, id)
|
result := client.WithContext(ctx).Delete(&source, id)
|
||||||
|
@ -118,7 +118,7 @@ func GetUserSourceByID(ctx context.Context, id models.UserSourceID) (models.User
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(id) != 25 {
|
if len(id) != 25 {
|
||||||
return models.UserSource{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.UserSourceIsWrongLength})
|
return models.UserSource{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.UserSourceIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
result := client.WithContext(ctx).First(&user, "id = ?", id)
|
result := client.WithContext(ctx).First(&user, "id = ?", id)
|
||||||
@ -157,7 +157,7 @@ func DeleteUserSource(ctx context.Context, id models.UserSourceID) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(id) != 25 {
|
if len(id) != 25 {
|
||||||
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.UserSourceIsWrongLength})
|
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.UserSourceIDToShort})
|
||||||
}
|
}
|
||||||
|
|
||||||
result := client.WithContext(ctx).Delete(&user, id)
|
result := client.WithContext(ctx).Delete(&user, id)
|
||||||
|
@ -3,13 +3,13 @@ package error
|
|||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
SourceListIsEmpty = "sourceList cannot be empty"
|
SourceListIsEmpty = "sourceList cannot be empty"
|
||||||
SourceIDIsEmpty = "SourceID cannot be empty"
|
SourceIDIsEmpty = "SourceID cannot be empty"
|
||||||
SourceIDIsWrongLength = "sourceID has the wrong length"
|
SourceIDToShort = "sourceID needs to be 25 characters long"
|
||||||
SourceDomainIsEmpty = "source Domain cannot be empty"
|
SourceDomainIsEmpty = "source Domain cannot be empty"
|
||||||
|
|
||||||
UserSourceIDIsEmpty = "userSourceID cannot be empty"
|
UserSourceIDIsEmpty = "userSourceID cannot be empty"
|
||||||
UserSourceIsWrongLength = "userSourceID has the wrong length"
|
UserSourceIDToShort = "userSourceID needs to be 25 characters long"
|
||||||
|
|
||||||
TagNameIsEmpty = "tagName cannot be empty"
|
TagNameIsEmpty = "tagName cannot be empty"
|
||||||
TagTypeIsEmpty = "tagType cannot be empty"
|
TagTypeIsEmpty = "tagType cannot be empty"
|
||||||
@ -21,18 +21,18 @@ const (
|
|||||||
TagGroupListIsEmpty = "tagGroupList cannot be empty"
|
TagGroupListIsEmpty = "tagGroupList cannot be empty"
|
||||||
TagGroupNameIsEmpty = "tagGroupName cannot be empty"
|
TagGroupNameIsEmpty = "tagGroupName cannot be empty"
|
||||||
|
|
||||||
UserFavoriteListIsEmpty = "userFavoriteList cannot be empty"
|
UserFavoriteListIsEmpty = "userFavoriteList cannot be empty"
|
||||||
UserFavoriteIDIsEmpty = "userFavoriteID cannot be empty"
|
UserFavoriteIDIsEmpty = "userFavoriteID cannot be empty"
|
||||||
UserFavoriteIsWrongLength = "userFavoriteID has the wrong length"
|
UserFavoriteIDToShort = "userFavoriteID needs to be 25 characters long"
|
||||||
|
|
||||||
PostListIsEmpty = "userFavoriteList cannot be empty"
|
PostListIsEmpty = "userFavoriteList cannot be empty"
|
||||||
PostIDIsEmpty = "userFavoriteID cannot be empty"
|
PostIDIsEmpty = "userFavoriteID cannot be empty"
|
||||||
PostIDIsWrongLength = "PostID has the wrong length"
|
PostIDToShort = "PostID needs to be 25 characters long"
|
||||||
|
|
||||||
BatchSizeIsEmpty = "batchSize cannot be empty"
|
BatchSizeIsEmpty = "batchSize cannot be empty"
|
||||||
|
|
||||||
PoolIDIsEmpty = "PoolID cannot be empty"
|
PoolIDIsEmpty = "PoolID cannot be empty"
|
||||||
PoolIDIsWrongLength = "PoolID has the wrong length"
|
PoolIDToShort = "PoolID needs to be 25 characters long"
|
||||||
|
|
||||||
PoolURLIsEmpty = "PoolURL cannot be empty"
|
PoolURLIsEmpty = "PoolURL cannot be empty"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user