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
8d7d54ac
Commit
8d7d54ac
authored
Oct 18, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Issue Board API to handle with has_many association
parent
d1458d92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
10 deletions
+4
-10
lib/api/boards.rb
lib/api/boards.rb
+3
-9
spec/requests/api/boards_spec.rb
spec/requests/api/boards_spec.rb
+1
-1
No files found.
lib/api/boards.rb
View file @
8d7d54ac
...
...
@@ -22,13 +22,7 @@ module API
segment
':id/boards/:board_id'
do
helpers
do
def
project_board
board
=
user_project
.
boards
.
first
if
params
[
:board_id
]
==
board
.
id
board
else
not_found!
(
'Board'
)
end
user_project
.
boards
.
find
(
params
[
:board_id
])
end
def
board_lists
...
...
@@ -92,12 +86,12 @@ module API
requires
:position
,
type:
Integer
,
desc:
'The position of the list'
end
put
'/lists/:list_id'
do
list
=
project_board
.
lists
.
movable
.
find
(
params
[
:list_id
])
list
=
board_lists
.
find
(
params
[
:list_id
])
authorize!
(
:admin_list
,
user_project
)
service
=
::
Boards
::
Lists
::
MoveService
.
new
(
user_project
,
current_user
,
{
position:
params
[
:position
]
})
{
position:
params
[
:position
]
.
to_i
})
if
service
.
execute
(
list
)
present
list
,
with:
Entities
::
List
...
...
spec/requests/api/boards_spec.rb
View file @
8d7d54ac
...
...
@@ -51,7 +51,7 @@ describe API::API, api: true do
end
context
"when authenticated"
do
it
"returns the project issue board"
do
it
"returns the project issue board
s
"
do
get
api
(
base_url
,
user
)
expect
(
response
).
to
have_http_status
(
200
)
...
...
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