Skip to content

Commit

Permalink
feat: support pagination of articles endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
knopki committed Feb 8, 2023
1 parent d984987 commit 5c768f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions insales/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,10 @@ def delete_blog(self, blog_id):
#========================================================================
# Статьи (в блоге)
#========================================================================
def get_articles(self, blog_id):
return self._get('/admin/blogs/%s/articles.xml' % blog_id)
def get_articles(self, blog_id, per_page = 10, page = 1):
"Get orders: https://api.insales.ru/?doc_format=XML#article-get-articles-list-xml"
qargs = {"per_page": per_page, "page": page}
return self._get('/admin/blogs/%s/articles.xml' % blog_id, qargs) or []

def get_article(self, blog_id, article_id):
return self._get('/admin/blogs/%s/articles/%s.xml' % (blog_id, article_id))
Expand Down

0 comments on commit 5c768f4

Please sign in to comment.