Skip to content

Commit

Permalink
fix: list component type
Browse files Browse the repository at this point in the history
Signed-off-by: Akshay Patidar <[email protected]>
  • Loading branch information
akshaypatidar1999 committed Dec 24, 2024
1 parent d996fcb commit 1fd1bbb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/list/componentType.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func componentExecute(cmd *cobra.Command) {
response, err := componentTypeClient.ListComponentType(&ctx, &component.ListComponentTypeRequest{
Params: params,
})

if err != nil {
log.Fatal("Failed to list component types ", err)
}
Expand Down Expand Up @@ -79,11 +78,10 @@ func componentWriteAsText(response *component.ListComponentTypeResponse) {
var tableData [][]interface{}
for _, compType := range response.Components {
tableData = append(tableData, []interface{}{
compType.ComponentType,
compType.ComponentVersion,
*compType.ComponentType,
*compType.ComponentVersion,
})
}

table.Write(tableHeaders, tableData)
}

Expand All @@ -92,7 +90,7 @@ func componentWriteAsJSON(response *component.ListComponentTypeResponse) {
for _, compType := range response.Components {
componentTypes = append(componentTypes, map[string]interface{}{
"name": compType.ComponentType,
"version": compType.ComponentType,
"version": compType.ComponentVersion,
})
}
output, _ := json.MarshalIndent(componentTypes, "", " ")
Expand Down

0 comments on commit 1fd1bbb

Please sign in to comment.