fix: consistent id check
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 2m59s
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 2m59s
- use consistent methode to check if the id is 0
This commit is contained in:
parent
0c9180bff3
commit
6b2d9e2cb5
@ -32,7 +32,7 @@ func CreatePoolPost(ctx context.Context, poolID models.PoolID, postID models.Pos
|
||||
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.Database{Reason: otterError.DatabaseIsNotConnected})
|
||||
}
|
||||
|
||||
if poolID == "" {
|
||||
if len(poolID) == 0 {
|
||||
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ func DeletePoolPost(ctx context.Context, poolID models.PoolID, postID models.Pos
|
||||
return utils.HandleError(ctx, span, localLogger, &otterError.Database{Reason: otterError.DatabaseIsNotConnected})
|
||||
}
|
||||
|
||||
if poolID == "" {
|
||||
if len(poolID) == 0 {
|
||||
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ func CreatePoolReference(ctx context.Context, poolID models.PoolID, sourceID mod
|
||||
return models.PoolReference{}, utils.HandleError(ctx, span, localLogger, &otterError.Database{Reason: otterError.DatabaseIsNotConnected})
|
||||
}
|
||||
|
||||
if poolID == "" {
|
||||
if len(poolID) == 0 {
|
||||
return models.PoolReference{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ func DeletePoolReference(ctx context.Context, poolID models.PoolID, sourceID mod
|
||||
return utils.HandleError(ctx, span, localLogger, &otterError.Database{Reason: otterError.DatabaseIsNotConnected})
|
||||
}
|
||||
|
||||
if poolID == "" {
|
||||
if len(poolID) == 0 {
|
||||
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user