Skip to content

Commit

Permalink
fix(dept):getId (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcorz committed Nov 2, 2023
1 parent 24142a3 commit 1c178cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Dept.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ public function delete(int $deptId): bool
*/
public function getId(string $alias = ''): array
{
$resp = HttpClient::get($this->app->url('/cgi/dept/list'), ['alias' => $alias]);
$data = !empty($alias) ? ['alias' => $alias] : [];
$resp = HttpClient::get($this->app->url('/cgi/dept/getid'), $data);
$decoded = json_decode($resp['body'], true, 512, JSON_THROW_ON_ERROR);

if ($decoded['errcode'] !== 0) {
Expand Down

0 comments on commit 1c178cd

Please sign in to comment.