Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
524b9070
Commit
524b9070
authored
Oct 21, 2012
by
Valeriy Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API: MergeRequest refactoring
parent
5a89934a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+4
-8
No files found.
lib/api/merge_requests.rb
View file @
524b9070
...
...
@@ -6,21 +6,18 @@ module Gitlab
resource
:projects
do
#list
get
":id/merge_requests"
do
project
=
current_user
.
projects
.
find
(
params
[
:id
])
present
project
.
merge_requests
,
with:
Entities
::
MergeRequest
present
user_project
.
merge_requests
,
with:
Entities
::
MergeRequest
end
#show
get
":id/merge_request/:merge_request_id"
do
project
=
current_user
.
projects
.
find
(
params
[
:id
])
present
project
.
merge_requests
.
find
(
params
[
:merge_request_id
]),
with:
Entities
::
MergeRequest
present
user_project
.
merge_requests
.
find
(
params
[
:merge_request_id
]),
with:
Entities
::
MergeRequest
end
#create merge_request
post
":id/merge_requests"
do
attrs
=
attributes_for_keys
[
:source_branch
,
:target_branch
,
:assignee_id
,
:title
]
project
=
current_user
.
projects
.
find
(
params
[
:id
])
merge_request
=
project
.
merge_requests
.
new
(
attrs
)
merge_request
=
user_project
.
merge_requests
.
new
(
attrs
)
merge_request
.
author
=
current_user
if
merge_request
.
save
...
...
@@ -34,8 +31,7 @@ module Gitlab
#update merge_request
put
":id/merge_request/:merge_request_id"
do
attrs
=
attributes_for_keys
[
:source_branch
,
:target_branch
,
:assignee_id
,
:title
,
:closed
]
project
=
current_user
.
projects
.
find
(
params
[
:id
])
merge_request
=
project
.
merge_requests
.
find
(
params
[
:merge_request_id
])
merge_request
=
user_project
.
merge_requests
.
find
(
params
[
:merge_request_id
])
if
merge_request
.
update_attributes
attrs
merge_request
.
reload_code
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment