Skip to content

Commit 16b3007

Browse files
[11.9] Correct upload avatar endpoint (#750)
1 parent 2912bfb commit 16b3007

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Api/Projects.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ public function uploadFile($project_id, string $file)
12071207
*/
12081208
public function uploadAvatar($project_id, string $file)
12091209
{
1210-
return $this->put($this->getProjectPath($project_id, ''), [], [], ['avatar' => $file]);
1210+
return $this->put('projects/'.self::encodePath($project_id), [], [], ['avatar' => $file]);
12111211
}
12121212

12131213
/**

tests/Api/ProjectsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2780,7 +2780,7 @@ public function shouldUploadAvatar(): void
27802780
$api = $this->getApiMock();
27812781
$api->expects($this->once())
27822782
->method('put')
2783-
->with('projects/1/', [], [], ['avatar' => $fileName])
2783+
->with('projects/1', [], [], ['avatar' => $fileName])
27842784
->will($this->returnValue($expectedArray));
27852785
$this->assertEquals($expectedArray, $api->uploadAvatar(1, $fileName));
27862786
\unlink($fileName);

0 commit comments

Comments
 (0)