Skip to content

Commit

Permalink
feat: added audit and change history endpoints.
Browse files Browse the repository at this point in the history
    - /api/audit: to get all the audit logs
    - /api/audit/:audit_id: to get the audit by its id
    - /api/audit/:audit_id/changes: to get all the change log of a particular audit
    - /api/audit/:audit_id/changes/:id: to get change of a particular change log

Signed-off-by: Kavya Shukla <kavyuushukla59@gmail.com>
  • Loading branch information
k-avy committed Aug 17, 2023
1 parent 721d8f1 commit cf7382f
Show file tree
Hide file tree
Showing 5 changed files with 404 additions and 22 deletions.
8 changes: 8 additions & 0 deletions cmd/laas/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,16 @@ func main() {
log.Fatalf("Failed to automigrate database: %v", err)
}

if err := db.DB.AutoMigrate(&models.Audit{}); err != nil {
log.Fatalf("Failed to automigrate database: %v", err)
}

if err := db.DB.AutoMigrate(&models.ChangeLog{}); err != nil {
log.Fatalf("Failed to automigrate database: %v", err)
}
db.Populatedb(*populatedb, *datafile)

r := api.Router()

r.Run()
}
Loading

0 comments on commit cf7382f

Please sign in to comment.