Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
f1ada2c2
Commit
f1ada2c2
authored
Oct 30, 2019
by
Greg Messner
Browse files
position parameter is now optional for createMergeRequestDiscussion() (#458).
parent
1fd1972f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/DiscussionsApi.java
View file @
f1ada2c2
...
...
@@ -309,15 +309,13 @@ public class DiscussionsApi extends AbstractApi {
public
Discussion
createMergeRequestDiscussion
(
Object
projectIdOrPath
,
Integer
mergeRequestIid
,
String
body
,
Date
createdAt
,
String
positionHash
,
Position
position
)
throws
GitLabApiException
{
if
(
position
==
null
)
{
throw
new
GitLabApiException
(
"position instance can not be null"
);
}
GitLabApiForm
formData
=
new
GitLabApiForm
()
.
withParam
(
"body"
,
body
,
true
)
.
withParam
(
"created_at"
,
createdAt
)
.
withParam
(
"position"
,
positionHash
)
.
withParam
(
"position[base_sha]"
,
position
.
getBaseSha
(),
true
)
.
withParam
(
"position"
,
positionHash
);
if
(
position
!=
null
)
{
formData
.
withParam
(
"position[base_sha]"
,
position
.
getBaseSha
(),
true
)
.
withParam
(
"position[start_sha]"
,
position
.
getStartSha
(),
true
)
.
withParam
(
"position[head_sha]"
,
position
.
getHeadSha
(),
true
)
.
withParam
(
"position[position_type]"
,
position
.
getPositionType
(),
true
)
...
...
@@ -329,6 +327,7 @@ public class DiscussionsApi extends AbstractApi {
.
withParam
(
"position[height]"
,
position
.
getHeight
())
.
withParam
(
"position[x]"
,
position
.
getX
())
.
withParam
(
"position[y]"
,
position
.
getY
());
}
Response
response
=
post
(
Response
.
Status
.
CREATED
,
formData
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"merge_requests"
,
mergeRequestIid
,
"discussions"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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