提交 246bb231 编写于 作者: D Douglas Barbosa Alexandre 提交者: Phil Hughes

Returns the total number of issues in the JSON response

上级 4d042afe
......@@ -8,12 +8,15 @@ module Projects
issues = ::Boards::Issues::ListService.new(project, current_user, filter_params).execute
issues = issues.page(params[:page])
render json: issues.as_json(
only: [:iid, :title, :confidential],
include: {
assignee: { only: [:id, :name, :username], methods: [:avatar_url] },
labels: { only: [:id, :title, :description, :color, :priority], methods: [:text_color] }
})
render json: {
issues: issues.as_json(
only: [:iid, :title, :confidential],
include: {
assignee: { only: [:id, :name, :username], methods: [:avatar_url] },
labels: { only: [:id, :title, :description, :color, :priority], methods: [:text_color] }
}),
size: issues.total_count
}
end
def update
......
{
"type": "array",
"items": { "$ref": "issue.json" }
"type": "object",
"required" : [
"issues",
"size"
],
"properties" : {
"issues": {
"type": "array",
"items": { "$ref": "issue.json" }
},
"size": { "type": "integer" }
},
"additionalProperties": false
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册