Skip to content

Commit d490e50

Browse files
committed
fix: addGroup、updateGroup exception
1 parent f4baefa commit d490e50

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

gitlab4j-api/src/main/java/org/gitlab4j/api/GroupApi.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ public Optional<Group> getOptionalGroup(Object groupIdOrPath) {
636636
* @throws GitLabApiException if any exception occurs
637637
*/
638638
public Group createGroup(GroupParams params) throws GitLabApiException {
639-
Response response = post(Response.Status.CREATED, params.getForm(true), "groups");
639+
Response response = post(Response.Status.CREATED, new GitLabApiForm(params.getForm(true)), "groups");
640640
return (response.readEntity(Group.class));
641641
}
642642

@@ -651,8 +651,11 @@ public Group createGroup(GroupParams params) throws GitLabApiException {
651651
* @throws GitLabApiException at any exception
652652
*/
653653
public Group updateGroup(Object groupIdOrPath, GroupParams params) throws GitLabApiException {
654-
Response response =
655-
putWithFormData(Response.Status.OK, params.getForm(false), "groups", getGroupIdOrPath(groupIdOrPath));
654+
Response response = putWithFormData(
655+
Response.Status.OK,
656+
new GitLabApiForm(params.getForm(false)),
657+
"groups",
658+
getGroupIdOrPath(groupIdOrPath));
656659
return (response.readEntity(Group.class));
657660
}
658661

@@ -2455,7 +2458,11 @@ public void revokeGroupAccessToken(Object groupIdOrPath, Long tokenId) throws Gi
24552458
*/
24562459
public GroupHook addWebhook(Object groupIdOrPath, GroupHookParams groupHookParams) throws GitLabApiException {
24572460
Response response = post(
2458-
Response.Status.CREATED, groupHookParams.getForm(), "groups", getGroupIdOrPath(groupIdOrPath), "hooks");
2461+
Response.Status.CREATED,
2462+
new GitLabApiForm(groupHookParams.getForm()),
2463+
"groups",
2464+
getGroupIdOrPath(groupIdOrPath),
2465+
"hooks");
24592466
return (response.readEntity(GroupHook.class));
24602467
}
24612468

0 commit comments

Comments
 (0)