More management tools
Some checks failed
CI / Test (1.22) (push) Failing after -30m28s
CI / Lint (push) Failing after -30m32s
CI / Build (push) Failing after -30m31s
CI / Test (1.23) (push) Failing after -30m31s

This commit is contained in:
2026-03-04 22:30:40 +02:00
parent 4a716bb82d
commit 4b44340c58
25 changed files with 3094 additions and 230 deletions

View File

@@ -12,8 +12,9 @@ import (
// ListCatalogs returns all product catalogs linked to the business account.
func (c *Client) ListCatalogs(ctx context.Context) (*CatalogListResponse, error) {
if c.config.BusinessAccountID == "" {
return nil, errNoBusinessAccount
wabaID, err := c.resolveWABAID(ctx)
if err != nil {
return nil, err
}
params := url.Values{
@@ -21,7 +22,7 @@ func (c *Client) ListCatalogs(ctx context.Context) (*CatalogListResponse, error)
}
var resp CatalogListResponse
if err := c.graphAPIGet(ctx, c.config.BusinessAccountID+"/catalogs", params, &resp); err != nil {
if err := c.graphAPIGet(ctx, wabaID+"/product_catalogs", params, &resp); err != nil {
return nil, err
}
return &resp, nil