Returns label description in JSON when listing lists/issues
This commit is contained in:
parent
215bfd1c9d
commit
01b9744d1e
5 changed files with 8 additions and 4 deletions
|
@ -14,7 +14,7 @@ class Projects::BoardIssuesController < Projects::ApplicationController
|
|||
only: [:iid, :title, :confidential],
|
||||
include: {
|
||||
assignee: { only: [:id, :name, :username], methods: [:avatar_url] },
|
||||
labels: { only: [:id, :title, :color, :priority] }
|
||||
labels: { only: [:id, :title, :description, :color, :priority] }
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ class Projects::BoardListsController < Projects::ApplicationController
|
|||
list = Boards::Lists::CreateService.new(project, current_user, list_params).execute
|
||||
|
||||
if list.valid?
|
||||
render json: list.as_json(only: [:id, :list_type, :position], methods: [:title], include: { label: { only: [:id, :title, :color, :priority] } })
|
||||
render json: list.as_json(only: [:id, :list_type, :position], methods: [:title], include: { label: { only: [:id, :title, :description, :color, :priority] } })
|
||||
else
|
||||
render json: list.errors, status: :unprocessable_entity
|
||||
end
|
||||
|
@ -39,7 +39,7 @@ class Projects::BoardListsController < Projects::ApplicationController
|
|||
service = Boards::Lists::GenerateService.new(project, current_user)
|
||||
|
||||
if service.execute
|
||||
render json: project.board.lists.label.as_json(only: [:id, :list_type, :position], methods: [:title], include: { label: { only: [:id, :title, :color, :priority] } })
|
||||
render json: project.board.lists.label.as_json(only: [:id, :list_type, :position], methods: [:title], include: { label: { only: [:id, :title, :description, :color, :priority] } })
|
||||
else
|
||||
head :unprocessable_entity
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ class Projects::BoardsController < Projects::ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render json: board.lists.as_json(only: [:id, :list_type, :position], methods: [:title], include: { label: { only: [:id, :title, :color, :priority] } }) }
|
||||
format.json { render json: board.lists.as_json(only: [:id, :list_type, :position], methods: [:title], include: { label: { only: [:id, :title, :description, :color, :priority] } }) }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
2
spec/fixtures/api/schemas/issue.json
vendored
2
spec/fixtures/api/schemas/issue.json
vendored
|
@ -14,6 +14,7 @@
|
|||
"required": [
|
||||
"id",
|
||||
"color",
|
||||
"description",
|
||||
"title",
|
||||
"priority"
|
||||
],
|
||||
|
@ -23,6 +24,7 @@
|
|||
"type": "string",
|
||||
"pattern": "^#[0-9A-Fa-f]{3}{1,2}+$"
|
||||
},
|
||||
"description": { "type": ["string", "null"] },
|
||||
"title": { "type": "string" },
|
||||
"priority": { "type": ["integer", "null"] }
|
||||
}
|
||||
|
|
2
spec/fixtures/api/schemas/list.json
vendored
2
spec/fixtures/api/schemas/list.json
vendored
|
@ -17,6 +17,7 @@
|
|||
"required": [
|
||||
"id",
|
||||
"color",
|
||||
"description",
|
||||
"title",
|
||||
"priority"
|
||||
],
|
||||
|
@ -26,6 +27,7 @@
|
|||
"type": "string",
|
||||
"pattern": "^#[0-9A-Fa-f]{3}{1,2}+$"
|
||||
},
|
||||
"description": { "type": ["string", "null"] },
|
||||
"title": { "type": "string" },
|
||||
"priority": { "type": ["integer", "null"] }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue