fix: consistent id check
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 3m2s
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:
parent
6b2d9e2cb5
commit
28c19101be
@ -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})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user