fix: Update article count in portal admin dashboard (#5647)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -13,12 +13,6 @@ json.category do
|
||||
json.locale article.category.locale
|
||||
end
|
||||
|
||||
if article.portal.present?
|
||||
json.portal do
|
||||
json.partial! 'api/v1/accounts/portals/portal', formats: [:json], portal: article.portal
|
||||
end
|
||||
end
|
||||
|
||||
json.views article.views
|
||||
|
||||
if article.author.present?
|
||||
|
||||
@@ -8,7 +8,7 @@ json.account_id article.account_id
|
||||
|
||||
if article.portal.present?
|
||||
json.portal do
|
||||
json.partial! 'api/v1/accounts/portals/portal', formats: [:json], portal: article.portal
|
||||
json.partial! 'api/v1/accounts/portals/portal', formats: [:json], portal: article.portal, articles: []
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -3,10 +3,11 @@ json.payload do
|
||||
end
|
||||
|
||||
json.meta do
|
||||
json.current_page @current_page
|
||||
json.articles_count @articles_count
|
||||
json.all_articles_count @portal_articles.size
|
||||
json.archived_articles_count @articles.archived.size
|
||||
json.articles_count @articles_count
|
||||
json.current_page @current_page
|
||||
json.draft_articles_count @all_articles.draft.size
|
||||
json.mine_articles_count @all_articles.search_by_author(current_user.id).size if current_user.present?
|
||||
json.published_count @articles.published.size
|
||||
json.draft_articles_count @articles.draft.size
|
||||
json.mine_articles_count @articles.search_by_author(current_user.id).size if current_user.present?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user