Returns label priority in JSON when listing lists/issues

parent 1b7f137e
......@@ -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] }
labels: { only: [:id, :title, :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] } })
render json: list.as_json(only: [:id, :list_type, :position], methods: [:title], include: { label: { only: [:id, :title, :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] } })
render json: project.board.lists.label.as_json(only: [:id, :list_type, :position], methods: [:title], include: { label: { only: [:id, :title, :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] } }) }
format.json { render json: board.lists.as_json(only: [:id, :list_type, :position], methods: [:title], include: { label: { only: [:id, :title, :color, :priority] } }) }
end
end
......
......@@ -14,7 +14,8 @@
"required": [
"id",
"color",
"title"
"title",
"priority"
],
"properties": {
"id": { "type": "integer" },
......@@ -22,7 +23,8 @@
"type": "string",
"pattern": "^#[0-9A-Fa-f]{3}{1,2}+$"
},
"title": { "type": "string" }
"title": { "type": "string" },
"priority": { "type": ["integer", "null"] }
}
},
"assignee": {
......
......@@ -17,7 +17,8 @@
"required": [
"id",
"color",
"title"
"title",
"priority"
],
"properties": {
"id": { "type": "integer" },
......@@ -25,7 +26,8 @@
"type": "string",
"pattern": "^#[0-9A-Fa-f]{3}{1,2}+$"
},
"title": { "type": "string" }
"title": { "type": "string" },
"priority": { "type": ["integer", "null"] }
}
},
"title": { "type": "string" },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment