@@ -82,10 +82,6 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
8282 if err != nil {
8383 return err
8484 }
85- if len (projects ) == 0 {
86- params .Printer .Info ("No projects found matching the criteria\n " )
87- return nil
88- }
8985
9086 return outputResult (params .Printer , model .OutputFormat , projects )
9187 },
@@ -192,7 +188,7 @@ func fetchProjects(ctx context.Context, model *inputModel, apiClient resourceMan
192188 if err != nil {
193189 return nil , fmt .Errorf ("get projects: %w" , err )
194190 }
195- respProjects := * resp .Items
191+ respProjects := resp .GetItems ()
196192 if len (respProjects ) == 0 {
197193 break
198194 }
@@ -214,6 +210,10 @@ func fetchProjects(ctx context.Context, model *inputModel, apiClient resourceMan
214210
215211func outputResult (p * print.Printer , outputFormat string , projects []resourcemanager.Project ) error {
216212 return p .OutputResult (outputFormat , projects , func () error {
213+ if len (projects ) == 0 {
214+ p .Outputf ("No projects found matching the criteria\n " )
215+ return nil
216+ }
217217 table := tables .NewTable ()
218218 table .SetHeader ("ID" , "NAME" , "STATE" , "PARENT ID" )
219219 for i := range projects {
0 commit comments