Skip to content

Commit

Permalink
Add Builtin flag to Questionnaire resource
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Lucidi <slucidi@redhat.com>
  • Loading branch information
mansam committed Oct 10, 2023
1 parent dcf41ee commit 9aba561
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/questionnaire.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ type Questionnaire struct {
Sections []assessment.Section `json:"sections" yaml:"sections" binding:"required"`
Thresholds assessment.Thresholds `json:"thresholds" yaml:"thresholds" binding:"required"`
RiskMessages assessment.RiskMessages `json:"riskMessages" yaml:"riskMessages" binding:"required"`
Builtin bool `json:"builtin,omitempty" yaml:"builtin,omitempty"`
}

// With updates the resource with the model.
Expand All @@ -203,6 +204,7 @@ func (r *Questionnaire) With(m *model.Questionnaire) {
r.Name = m.Name
r.Description = m.Description
r.Required = m.Required
r.Builtin = m.Builtin()
_ = json.Unmarshal(m.Sections, &r.Sections)
_ = json.Unmarshal(m.Thresholds, &r.Thresholds)
_ = json.Unmarshal(m.RiskMessages, &r.RiskMessages)
Expand Down

0 comments on commit 9aba561

Please sign in to comment.