From 7f49556aa950f0659f8546aa7c4a3a3e835a1cbd Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 30 Apr 2023 19:50:52 +0100 Subject: [PATCH 1/3] Correct upload avatar endpoint --- src/Api/Projects.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/Projects.php b/src/Api/Projects.php index 1ca253c0..5b497ddc 100644 --- a/src/Api/Projects.php +++ b/src/Api/Projects.php @@ -1207,7 +1207,7 @@ public function uploadFile($project_id, string $file) */ public function uploadAvatar($project_id, string $file) { - return $this->put($this->getProjectPath($project_id, ''), [], [], ['avatar' => $file]); + return $this->put('projects/'.self::encodePath($id), [], [], ['avatar' => $file]); } /** From 01a3b24b00a5a55ce189d24f43737d5b7100a057 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 30 Apr 2023 19:51:34 +0100 Subject: [PATCH 2/3] Update ProjectsTest.php --- tests/Api/ProjectsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Api/ProjectsTest.php b/tests/Api/ProjectsTest.php index bc7e64e0..6def3b0d 100644 --- a/tests/Api/ProjectsTest.php +++ b/tests/Api/ProjectsTest.php @@ -2780,7 +2780,7 @@ public function shouldUploadAvatar(): void $api = $this->getApiMock(); $api->expects($this->once()) ->method('put') - ->with('projects/1/', [], [], ['avatar' => $fileName]) + ->with('projects/1', [], [], ['avatar' => $fileName]) ->will($this->returnValue($expectedArray)); $this->assertEquals($expectedArray, $api->uploadAvatar(1, $fileName)); \unlink($fileName); From 83311f18778b9cbb7b103f88333747c40ee32281 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 30 Apr 2023 19:53:27 +0100 Subject: [PATCH 3/3] Update Projects.php --- src/Api/Projects.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/Projects.php b/src/Api/Projects.php index 5b497ddc..43773b12 100644 --- a/src/Api/Projects.php +++ b/src/Api/Projects.php @@ -1207,7 +1207,7 @@ public function uploadFile($project_id, string $file) */ public function uploadAvatar($project_id, string $file) { - return $this->put('projects/'.self::encodePath($id), [], [], ['avatar' => $file]); + return $this->put('projects/'.self::encodePath($project_id), [], [], ['avatar' => $file]); } /**