Skip to content

Commit

Permalink
fix error, PR suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal-Delange committed May 24, 2024
1 parent 3dfba82 commit 5541dc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion api/handle_ingestion.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import (
"io"
"net/http"

"github.com/cockroachdb/errors"
"github.com/gin-gonic/gin"

"github.com/checkmarble/marble-backend/dto"
"github.com/checkmarble/marble-backend/models"
"github.com/checkmarble/marble-backend/pure_utils"
"github.com/checkmarble/marble-backend/utils"
)
Expand All @@ -21,7 +23,8 @@ func (api *API) handleIngestion(c *gin.Context) {

objectType := c.Param("object_type")
objectBody, err := io.ReadAll(c.Request.Body)
if presentError(c, err) {
if err != nil {
presentError(c, errors.Wrap(models.BadParameterError, err.Error()))
return
}

Expand Down
1 change: 0 additions & 1 deletion usecases/ingestion_usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func (usecase *IngestionUseCase) IngestObjects(
var nb int
ingestClosure := func() error {
return usecase.transactionFactory.TransactionInOrgSchema(ctx, organizationId, func(tx repositories.Executor) error {
var err error
nb, err = usecase.ingestionRepository.IngestObjects(ctx, tx, []models.ClientObject{payload}, table)
return err
})
Expand Down

0 comments on commit 5541dc0

Please sign in to comment.