@@ -1763,23 +1763,23 @@ public GitlabDiscussion createTextDiscussion(GitlabMergeRequest mergeRequest,
1763
1763
String positionHeadSha , String positionNewPath , Integer positionNewLine ,
1764
1764
String positionOldPath , Integer positionOldLine ) throws IOException {
1765
1765
checkRequiredCreateDiscussionArguments (body , positionBaseSha , positionStartSha , positionHeadSha );
1766
+ Query query = new Query ()
1767
+ .append ("body" , body )
1768
+ .appendIf ("position" , position )
1769
+ .append ("position[base_sha]" , positionBaseSha )
1770
+ .append ("position[start_sha]" , positionStartSha )
1771
+ .append ("position[head_sha]" , positionHeadSha )
1772
+ .append ("position[position_type]" , "text" )
1773
+ .appendIf ("position[new_path]" , positionNewPath )
1774
+ .appendIf ("position[new_line]" , positionNewLine )
1775
+ .appendIf ("position[old_path]" , positionOldPath )
1776
+ .appendIf ("position[old_line]" , positionOldLine );
1766
1777
1767
1778
String tailUrl = GitlabProject .URL + "/" + mergeRequest .getProjectId () +
1768
1779
GitlabMergeRequest .URL + "/" + mergeRequest .getIid () +
1769
- GitlabDiscussion .URL ;
1780
+ GitlabDiscussion .URL + query . toString () ;
1770
1781
1771
- return dispatch ()
1772
- .with ("body" , body )
1773
- .with ("position" , position )
1774
- .with ("position[base_sha]" , positionBaseSha )
1775
- .with ("position[start_sha]" , positionStartSha )
1776
- .with ("position[head_sha]" , positionHeadSha )
1777
- .with ("position[position_type]" , "text" )
1778
- .with ("position[new_path]" , positionNewPath )
1779
- .with ("position[new_line]" , positionNewLine )
1780
- .with ("position[old_path]" , positionOldPath )
1781
- .with ("position[old_line]" , positionOldLine )
1782
- .to (tailUrl , GitlabDiscussion .class );
1782
+ return dispatch ().to (tailUrl , GitlabDiscussion .class );
1783
1783
}
1784
1784
1785
1785
/**
@@ -1810,25 +1810,25 @@ public GitlabDiscussion createImageDiscussion(
1810
1810
Integer positionY
1811
1811
) throws IOException {
1812
1812
checkRequiredCreateDiscussionArguments (body , positionBaseSha , positionStartSha , positionHeadSha );
1813
+ Query query = new Query ()
1814
+ .append ("body" , body )
1815
+ .appendIf ("position" , position )
1816
+ .append ("position[base_sha]" , positionBaseSha )
1817
+ .append ("position[start_sha]" , positionStartSha )
1818
+ .append ("position[head_sha]" , positionHeadSha )
1819
+ .append ("position[position_type]" , "image" )
1820
+ .appendIf ("position[new_path]" , positionNewPath )
1821
+ .appendIf ("position[old_path]" , positionOldPath )
1822
+ .appendIf ("position[width]" , positionWidth )
1823
+ .appendIf ("position[height]" , positionHeight )
1824
+ .appendIf ("position[x]" , positionX )
1825
+ .appendIf ("position[y]" , positionY );
1813
1826
1814
1827
String tailUrl = GitlabProject .URL + "/" + mergeRequest .getProjectId () +
1815
1828
GitlabMergeRequest .URL + "/" + mergeRequest .getIid () +
1816
- GitlabDiscussion .URL ;
1829
+ GitlabDiscussion .URL + query . toString () ;
1817
1830
1818
- return dispatch ()
1819
- .with ("body" , body )
1820
- .with ("position" , position )
1821
- .with ("position[base_sha]" , positionBaseSha )
1822
- .with ("position[start_sha]" , positionStartSha )
1823
- .with ("position[head_sha]" , positionHeadSha )
1824
- .with ("position[position_type]" , "image" )
1825
- .with ("position[new_path]" , positionNewPath )
1826
- .with ("position[old_path]" , positionOldPath )
1827
- .with ("position[width]" , positionWidth )
1828
- .with ("position[height]" , positionHeight )
1829
- .with ("position[x]" , positionX )
1830
- .with ("position[y]" , positionY )
1831
- .to (tailUrl , GitlabDiscussion .class );
1831
+ return dispatch ().to (tailUrl , GitlabDiscussion .class );
1832
1832
}
1833
1833
1834
1834
/**
0 commit comments