Small code cleanup.

This commit is contained in:
James Cole
2024-03-16 22:57:48 +01:00
parent f0fa21dead
commit 1bd3019c16
4 changed files with 6 additions and 10 deletions

View File

@@ -68,14 +68,12 @@ class UpdateController extends Controller
$account->refresh();
app('preferences')->mark();
$transformer = new AccountTransformer();
$transformer = new AccountTransformer();
$transformer->setParameters($this->parameters);
return response()
->api($this->jsonApiObject('accounts', $account, $transformer))
->header('Content-Type', self::CONTENT_TYPE)
;
;
}
}

View File

@@ -35,13 +35,12 @@ use Illuminate\Foundation\Http\FormRequest;
class UpdateRequest extends FormRequest
{
use ChecksLogin;
use AppendsLocationData;
use ChecksLogin;
use ConvertsDataTypes;
/**
* TODO is a duplicate of the v1 update thing.
* @return array
*/
public function getUpdateData(): array
{
@@ -114,6 +113,4 @@ class UpdateRequest extends FormRequest
return Location::requestRules($rules);
}
}

View File

@@ -293,7 +293,8 @@ class AccountRepository implements AccountRepositoryInterface
return $dbQuery->take($limit)->get(['accounts.*']);
}
#[\Override] public function update(Account $account, array $data): Account
#[\Override]
public function update(Account $account, array $data): Account
{
/** @var AccountUpdateService $service */
$service = app(AccountUpdateService::class);

View File

@@ -72,7 +72,7 @@ interface AccountRepositoryInterface
public function setUser(User $user): void;
public function update(Account $account,array $data): Account;
public function update(Account $account, array $data): Account;
public function setUserGroup(UserGroup $userGroup): void;
}