MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
945 stars 278 forks source link

Fetch published blogs #537

Closed djdonmil closed 2 years ago

djdonmil commented 2 years ago

Hi, in my Node project I am fetching articles from shopify app. Code:

await shopify.article.list(blockId, { limit: 2 }); Now here I am getting both published/unpublished articles. I only want to fetch published articles. Can you suggest me, which params I need to pass to fetch only published articles?

Thanks in advance.

lpinca commented 2 years ago

See https://shopify.dev/api/admin-rest/2022-04/resources/article#get-blogs-blog-id-articles

await shopify.article.list(blogId, { limit: 2, published_status: 'published' });
djdonmil commented 2 years ago

@lpinca thanks a lot... It helped me