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

- use consistent methode to check if the id is 0
This commit is contained in:
SoXX 2024-10-15 10:51:20 +02:00
parent 6b2d9e2cb5
commit 28c19101be

View File

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