Skip to content

Commit

Permalink
Merge pull request #45 from siemens/sort_audit
Browse files Browse the repository at this point in the history
fix(audits): Order audits in descending order by id

Reviewed-by: [email protected]
Tested-by: [email protected]
  • Loading branch information
GMishx authored Feb 28, 2024
2 parents 6152d25 + e4325ea commit 3090c7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/api/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func GetAllAudit(c *gin.Context) {

_ = utils.PreparePaginateResponse(c, query, &models.AuditResponse{})

if err := query.Find(&audit).Error; err != nil {
if err := query.Order("timestamp desc").Find(&audit).Error; err != nil {
er := models.LicenseError{
Status: http.StatusInternalServerError,
Message: "unable to fetch audits",
Expand Down

0 comments on commit 3090c7d

Please sign in to comment.