GetBlueprint returns the detail of a given Blueprint ID
(blueprintId uint64, shouldSanitize bool)
| 99 | |
| 100 | // GetBlueprint returns the detail of a given Blueprint ID |
| 101 | func GetBlueprint(blueprintId uint64, shouldSanitize bool) (*models.Blueprint, errors.Error) { |
| 102 | blueprint, err := bpManager.GetDbBlueprint(blueprintId) |
| 103 | if err != nil { |
| 104 | if db.IsErrorNotFound(err) { |
| 105 | return nil, errors.NotFound.New("blueprint not found") |
| 106 | } |
| 107 | return nil, errors.Internal.Wrap(err, "error getting the blueprint from database") |
| 108 | } |
| 109 | if shouldSanitize { |
| 110 | if err := SanitizeBlueprint(blueprint); err != nil { |
| 111 | return nil, errors.Convert(err) |
| 112 | } |
| 113 | } |
| 114 | return blueprint, nil |
| 115 | } |
| 116 | |
| 117 | // GetBlueprintByProjectName returns the detail of a given ProjectName |
| 118 | func GetBlueprintByProjectName(projectName string) (*models.Blueprint, errors.Error) { |
no test coverage detected