summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNihad Abbasov <narkoz.2008@gmail.com>2012-07-25 04:22:21 -0700
committerNihad Abbasov <narkoz.2008@gmail.com>2012-07-25 04:22:21 -0700
commitf7dd067490fe57505f7226c3b54d3127d2f7fd46 (patch)
treef8c4b21c036339f92fcc5482aa28a41250553b27
parent949b1df930bedace1dbd755aaa4a82e8c451a616 (diff)
downloadgitlab-ce-f7dd067490fe57505f7226c3b54d3127d2f7fd46.tar.gz
API: expose issues project id
-rw-r--r--doc/api/issues.md3
-rw-r--r--lib/api/entities.rb4
2 files changed, 6 insertions, 1 deletions
diff --git a/doc/api/issues.md b/doc/api/issues.md
index 0ce14503ffc..aaad3305489 100644
--- a/doc/api/issues.md
+++ b/doc/api/issues.md
@@ -10,6 +10,7 @@ GET /issues
[
{
"id": 43,
+ "project_id": 8,
"title": "4xx/5xx pages",
"description": "",
"labels": [ ],
@@ -28,6 +29,7 @@ GET /issues
},
{
"id": 42,
+ "project_id": 8,
"title": "Add user settings",
"description": "",
"labels": [
@@ -91,6 +93,7 @@ Parameters:
```json
{
"id": 42,
+ "project_id": 8,
"title": "Add user settings",
"description": "",
"labels": [
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index e5095f7189e..d86fb79c78b 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -31,7 +31,9 @@ module Gitlab
end
class Issue < Grape::Entity
- expose :id, :title, :description
+ expose :id
+ expose (:project_id) {|issue| issue.project.id}
+ expose :title, :description
expose :label_list, :as => :labels
expose :milestone, :using => Entities::Milestone
expose :assignee, :author, :using => Entities::UserBasic