Skip to content

Commit

Permalink
OPENAPI: added commit information to flat report
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobm-splunk authored and daveshanley committed Mar 29, 2024
1 parent 33f30d0 commit f0bccc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/flatten_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ func FlattenReport(report *model.Report) *model.FlatReport {
changes = append(changes, change)
}
flatReport.Changes = changes

// Copy the Commit information from the report to the flatReport and then delete the changes
flatReport.Commit = &model.Commit{}
*flatReport.Commit = *report.Commit
flatReport.Commit.Changes = nil

return flatReport
}

Expand Down
1 change: 1 addition & 0 deletions model/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Report struct {
type FlatReport struct {
Summary map[string]*reports.Changed `json:"reportSummary"`
Changes []*model.Change `json:"changes"`
Commit *Commit `gorm:"foreignKey:ID" json:"commitDetails"`
}

type FlatHistoricalReport struct {
Expand Down

0 comments on commit f0bccc1

Please sign in to comment.