2022-06-13 10:26:49 +00:00
|
|
|
json.id article.id
|
|
|
|
json.title article.title
|
|
|
|
json.content article.content
|
|
|
|
json.description article.description
|
|
|
|
json.status article.status
|
|
|
|
json.account_id article.account_id
|
2022-08-02 11:44:10 +00:00
|
|
|
json.updated_at article.updated_at.to_i
|
2022-08-16 12:25:34 +00:00
|
|
|
json.meta article.meta
|
2022-08-08 10:17:32 +00:00
|
|
|
json.category do
|
|
|
|
json.id article.category_id
|
|
|
|
json.name article.category.name
|
2022-09-20 04:52:01 +00:00
|
|
|
json.slug article.category.slug
|
2022-09-21 01:23:28 +00:00
|
|
|
json.locale article.category.locale
|
2022-08-08 10:17:32 +00:00
|
|
|
end
|
|
|
|
|
2022-06-13 10:26:49 +00:00
|
|
|
json.views article.views
|
|
|
|
|
|
|
|
if article.author.present?
|
|
|
|
json.author do
|
2022-10-06 00:24:34 +00:00
|
|
|
json.partial! 'api/v1/models/agent', formats: [:json], resource: article.author
|
2022-06-13 10:26:49 +00:00
|
|
|
end
|
|
|
|
end
|
2022-07-04 14:59:44 +00:00
|
|
|
|
|
|
|
json.associated_articles do
|
|
|
|
if article.associated_articles.any?
|
|
|
|
json.array! article.associated_articles.each do |associated_article|
|
2022-10-06 00:24:34 +00:00
|
|
|
json.partial! 'api/v1/accounts/articles/associated_article', formats: [:json], article: associated_article
|
2022-07-04 14:59:44 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|