From 755aea20aa48a6eec16a0702d56811893815c44f Mon Sep 17 00:00:00 2001 From: SoXX Date: Tue, 15 Oct 2024 10:41:39 +0200 Subject: [PATCH] fix: consistent id check - use consistent methode to check if the id is 0 --- pkg/database/pool_post.go | 4 ++-- pkg/database/pool_reference.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/database/pool_post.go b/pkg/database/pool_post.go index 4d69595..686f205 100644 --- a/pkg/database/pool_post.go +++ b/pkg/database/pool_post.go @@ -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}) } diff --git a/pkg/database/pool_reference.go b/pkg/database/pool_reference.go index e675a07..ee6f381 100644 --- a/pkg/database/pool_reference.go +++ b/pkg/database/pool_reference.go @@ -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}) }