From 83336bb3c25f5d0894b3b91639a572bed26059a6 Mon Sep 17 00:00:00 2001 From: Laurent Bientz Date: Mon, 30 Oct 2023 12:49:31 +0100 Subject: [PATCH 1/2] feat: v9 api change for client update --- src/TogglApi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TogglApi.php b/src/TogglApi.php index 5d35c80..55017a6 100644 --- a/src/TogglApi.php +++ b/src/TogglApi.php @@ -67,7 +67,7 @@ public function createClient($workspaceId, $clientName) */ public function updateClient($workspaceId, $clientId, $clientData) { - return $this->PUT('clients/'.$clientId, ['client' => $clientData]); + return $this->workspace($workspaceId)->updateClient($clientId, ['client' => $clientData]); } /** From f410a019dfe7c1b6c5f5d959bfc3cba6015eda6b Mon Sep 17 00:00:00 2001 From: Laurent Bientz Date: Mon, 30 Oct 2023 12:55:59 +0100 Subject: [PATCH 2/2] feat: v9 api change for client update --- src/TogglApi.php | 6 +++--- src/TogglTrackWorkspaceApi.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/TogglApi.php b/src/TogglApi.php index 55017a6..6188ec8 100644 --- a/src/TogglApi.php +++ b/src/TogglApi.php @@ -61,13 +61,13 @@ public function createClient($workspaceId, $clientName) * Update client. * * @param int $clientId - * @param array $clientData + * @param array $client * * @return bool|mixed|object */ - public function updateClient($workspaceId, $clientId, $clientData) + public function updateClient($workspaceId, $clientId, $client) { - return $this->workspace($workspaceId)->updateClient($clientId, ['client' => $clientData]); + return $this->workspace($workspaceId)->updateClient($clientId, $client); } /** diff --git a/src/TogglTrackWorkspaceApi.php b/src/TogglTrackWorkspaceApi.php index 89c72dd..724430f 100644 --- a/src/TogglTrackWorkspaceApi.php +++ b/src/TogglTrackWorkspaceApi.php @@ -73,13 +73,13 @@ public function createClient($clientData) * Update client. * * @param int $clientId - * @param array $clientData + * @param array $client * * @return bool|mixed|object */ - public function updateClient($clientId, $clientData) + public function updateClient($clientId, $client) { - return $this->PUT('clients/' . $clientId, ['client' => $clientData]); + return $this->PUT("clients/{$clientId}", $client); } /**