More management tools
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user