diff --git a/Controller/ApiController.php b/Controller/ApiController.php index d7a4849..9b65d3d 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -156,8 +156,12 @@ final class ApiController extends Controller } /** @var Profile $profile */ - $profile = ProfileMapper::get()->with('account')->where('account', $request->header->account)->execute(); - $old = clone $profile; + $profile = ProfileMapper::get() + ->with('account') + ->where('account', $request->header->account) + ->execute(); + + $old = clone $profile; $uploaded = $this->app->moduleManager->get('Media')->uploadFiles( names: $request->getDataList('names'), diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 5fb4873..b181cfd 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -137,9 +137,8 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase $response = new HttpResponse(); $request = new HttpRequest(new HttpUri('')); - $request->header->account = 1; + $request->header->account = 2; $request->setData('names', 'Profile Logo'); - $request->setData('id', 1); TestUtils::setMember($request, 'files', [ 'file1' => [