新增:数据集文件分页

This commit is contained in:
yystopf 2024-04-03 16:33:07 +08:00
parent 8ac9592195
commit 7d560032b0
2 changed files with 2 additions and 1 deletions

View File

@ -22,7 +22,7 @@ class Api::V1::Projects::DatasetsController < Api::V1::BaseController
end
def show
@attachments = @project_dataset.attachments.includes(:author)
@attachments = kaminari_paginate(@project_dataset.attachments.includes(:author))
end
private

View File

@ -1,5 +1,6 @@
json.(@project_dataset, :id, :title, :description, :license_id, :paper_content)
json.license_name @project_dataset&.license&.name
json.attachment_total_count @attachments.total_count
json.attachments @attachments do |at|
json.partial! "api/v1/attachments/detail", locals: {attachment: at}
end