Skip to content

Commit

Permalink
fix: rm attempt to log error on successful GETs
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsOveTen committed Jun 13, 2024
1 parent fa3a9c1 commit 451e77d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions service/updateService.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,12 @@ func (service UpdateServiceImpl) GetUpdates(ctx context.Context, catalogId strin

if databaseUpdates == nil {
logrus.Error("No updates found")
logging.LogAndPrintError(err)
pagination := model.Pagination{ TotalPages: 0, Page: page, Size: size }
pagination := model.Pagination{TotalPages: 0, Page: page, Size: size}
return model.Updates{Updates: []model.Update{}, Pagination: pagination}, http.StatusOK
} else {
logrus.Info("Returning updates")
logging.LogAndPrintError(err)
logrus.Debug("Returning updates")
totalPages := int(math.Ceil(float64(count) / float64(size)))
pagination := model.Pagination{ TotalPages: totalPages, Page: page, Size: size }
pagination := model.Pagination{TotalPages: totalPages, Page: page, Size: size}
return model.Updates{Updates: databaseUpdates, Pagination: pagination}, http.StatusOK
}
}
Expand All @@ -113,7 +111,6 @@ func (service UpdateServiceImpl) GetUpdate(ctx context.Context, catalogId string
return nil, http.StatusInternalServerError
} else if update == nil {
logrus.Error("update not found")
logging.LogAndPrintError(err)
return nil, http.StatusNotFound
} else {
return update, http.StatusOK
Expand Down

0 comments on commit 451e77d

Please sign in to comment.