From 28c19101be32336179198c581ea41c430c1eb222 Mon Sep 17 00:00:00 2001 From: SoXX Date: Tue, 15 Oct 2024 10:51:20 +0200 Subject: [PATCH] fix: consistent id check - use consistent methode to check if the id is 0 --- pkg/database/pool_post.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/database/pool_post.go b/pkg/database/pool_post.go index 5c3948d..aeba635 100644 --- a/pkg/database/pool_post.go +++ b/pkg/database/pool_post.go @@ -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}) }