細部
This commit is contained in:
@@ -19,8 +19,16 @@ class PostsController < ApplicationController
|
|||||||
posts = posts.first(limit)
|
posts = posts.first(limit)
|
||||||
end
|
end
|
||||||
|
|
||||||
render json: { posts: posts.as_json(include: { tags: { only: [:id, :name, :category, :post_count] } }),
|
render json: { posts: posts.map { |post|
|
||||||
next_cursor: }
|
post.as_json(include: { tags: { only: [:id, :name, :category, :post_count] } }).tap { |json|
|
||||||
|
json['thumbnail'] =
|
||||||
|
if post.thumbnail.attached?
|
||||||
|
rails_storage_proxy_url(post.thumbnail, only_path: false)
|
||||||
|
else
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}, next_cursor: }
|
||||||
end
|
end
|
||||||
|
|
||||||
def random
|
def random
|
||||||
|
|||||||
Reference in New Issue
Block a user