fix: consistent id check
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 3m15s

- use consistent methode to check if the id is 0
This commit is contained in:
SoXX 2024-10-15 10:41:39 +02:00
parent 91254adfe3
commit 755aea20aa
2 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ func CreatePoolPost(ctx context.Context, poolID models.PoolID, postID models.Pos
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
}
if len(poolID) != 25 {
if len(poolID) == 0 {
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsWrongLength})
}
@ -92,7 +92,7 @@ func DeletePoolPost(ctx context.Context, poolID models.PoolID, postID models.Pos
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
}
if len(poolID) != 25 {
if len(poolID) == 0 {
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsWrongLength})
}

View File

@ -96,7 +96,7 @@ func DeletePoolReference(ctx context.Context, poolID models.PoolID, sourceID mod
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
}
if len(poolID) != 25 {
if len(poolID) == 0 {
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDIsWrongLength})
}