No longer have to submit mandatory fields to account end point. Just submit the field you wish to update, the rest will be untouched.

This commit is contained in:
James Cole
2019-08-24 07:56:08 +02:00
parent e5e3797d9c
commit d836c8217d
6 changed files with 161 additions and 71 deletions

View File

@@ -284,13 +284,13 @@ class AccountController extends Controller
* Update account.
*
* @param AccountUpdateRequest $request
* @param Account $account
* @param Account $account
*
* @return JsonResponse
*/
public function update(AccountUpdateRequest $request, Account $account): JsonResponse
{
$data = $request->getAllAccountData();
$data = $request->getUpdateData();
$data['type'] = config('firefly.shortNamesByFullName.' . $account->accountType->type);
$this->repository->update($account, $data);
$manager = new Manager;