mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 04:35:45 +08:00
新增:数据集文件分页
This commit is contained in:
@@ -22,7 +22,7 @@ class Api::V1::Projects::DatasetsController < Api::V1::BaseController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@attachments = @project_dataset.attachments.includes(:author)
|
@attachments = kaminari_paginate(@project_dataset.attachments.includes(:author))
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
json.(@project_dataset, :id, :title, :description, :license_id, :paper_content)
|
json.(@project_dataset, :id, :title, :description, :license_id, :paper_content)
|
||||||
json.license_name @project_dataset&.license&.name
|
json.license_name @project_dataset&.license&.name
|
||||||
|
json.attachment_total_count @attachments.total_count
|
||||||
json.attachments @attachments do |at|
|
json.attachments @attachments do |at|
|
||||||
json.partial! "api/v1/attachments/detail", locals: {attachment: at}
|
json.partial! "api/v1/attachments/detail", locals: {attachment: at}
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user