Improvements for certificates table, adds expansion object to certificates

This commit is contained in:
Jamie Curnow
2023-01-14 09:45:08 +10:00
parent 6c76c041c4
commit 456c59c746
9 changed files with 95 additions and 22 deletions

View File

@ -102,7 +102,7 @@ func Update(certificate *Model) error {
}
// List will return a list of certificates
func List(pageInfo model.PageInfo, filters []model.Filter) (ListResponse, error) {
func List(pageInfo model.PageInfo, filters []model.Filter, expand []string) (ListResponse, error) {
var result ListResponse
var exampleModel Model
@ -135,6 +135,15 @@ func List(pageInfo model.PageInfo, filters []model.Filter) (ListResponse, error)
return result, err
}
if expand != nil {
for idx := range items {
expandErr := items[idx].Expand(expand)
if expandErr != nil {
logger.Error("CertificatesExpansionError", expandErr)
}
}
}
result = ListResponse{
Items: items,
Total: totalRows,