package infra

import "fmt"

// MetabaseListDashboards lista dashboards de Metabase.
// filter: "all", "mine" o "archived" (vacio = todas).
func MetabaseListDashboards(client MetabaseClient, filter string) ([]map[string]any, error) {
	path := "/api/dashboard"
	if filter != "" {
		path += "?f=" + filter
	}

	result, err := metabaseRequestList("GET", client.BaseURL, client.Token, path, nil)
	if err != nil {
		return nil, fmt.Errorf("metabase list dashboards: %w", err)
	}

	return result, nil
}
