Skip to content

Commit b939389

Browse files
thanhdxuanJohnVillalovos
authored andcommitted
fix: api group update will create a new group rather than updating the group
1 parent 9f253ef commit b939389

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎WebServices/Controllers/GroupSaveController.php‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,19 @@ public function Create($request, $session)
134134
public function Update($groupId, $request, $session)
135135
{
136136
$errors = $this->ValidateRequest($request);
137+
if (empty($groupId)) {
138+
$errors[] = 'groupId is required';
139+
}
137140

138141
if (!empty($errors)) {
139142
return new GroupControllerResult(null, $errors);
140143
}
141144

142145
$presenter = $this->GetPresenter(new CreateGroupFacade($request, $groupId));
143146

144-
$id = $presenter->AddGroup();
147+
$presenter->UpdateGroup();
145148

146-
return new GroupControllerResult($id, null);
149+
return new GroupControllerResult($groupId);
147150
}
148151

149152
/**

0 commit comments

Comments
 (0)