Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
better response in attach and detach user group
Browse files Browse the repository at this point in the history
  • Loading branch information
Satya Kresna committed Jun 22, 2022
1 parent a9bd563 commit 3c7b6c2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/UserGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ public function attach($user_id, $group_id)
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);

return array($response, $httpcode);
return array(
'data' => json_decode($response, true),
'code' => (int) $httpcode
);
}

public function detach($user_id, $group_id)
Expand All @@ -53,6 +56,9 @@ public function detach($user_id, $group_id)
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);

return array($response, $httpcode);
return array(
'data' => json_decode($response, true),
'code' => (int) $httpcode
);
}
}

0 comments on commit 3c7b6c2

Please sign in to comment.