GetBlueprints returns a paginated list of Blueprints based on `query`
(query *BlueprintQuery, shouldSanitize bool)
| 74 | |
| 75 | // GetBlueprints returns a paginated list of Blueprints based on `query` |
| 76 | func GetBlueprints(query *BlueprintQuery, shouldSanitize bool) ([]*models.Blueprint, int64, errors.Error) { |
| 77 | blueprints, count, err := bpManager.GetDbBlueprints(&services.GetBlueprintQuery{ |
| 78 | Enable: query.Enable, |
| 79 | IsManual: query.IsManual, |
| 80 | Label: query.Label, |
| 81 | SkipRecords: query.GetSkip(), |
| 82 | PageSize: query.GetPageSize(), |
| 83 | Type: query.Type, |
| 84 | }) |
| 85 | if err != nil { |
| 86 | return nil, 0, err |
| 87 | } |
| 88 | if shouldSanitize { |
| 89 | for idx, bp := range blueprints { |
| 90 | if err := SanitizeBlueprint(bp); err != nil { |
| 91 | return nil, 0, errors.Convert(err) |
| 92 | } else { |
| 93 | blueprints[idx] = bp |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | return blueprints, count, nil |
| 98 | } |
| 99 | |
| 100 | // GetBlueprint returns the detail of a given Blueprint ID |
| 101 | func GetBlueprint(blueprintId uint64, shouldSanitize bool) (*models.Blueprint, errors.Error) { |
nothing calls this directly
no test coverage detected