Expand API options for available budgets and journal links

This commit is contained in:
James Cole
2018-08-11 18:27:45 +02:00
parent a803dfc7fa
commit 95ce72fce7
5 changed files with 83 additions and 18 deletions

View File

@@ -153,6 +153,9 @@ class AvailableBudgetController extends Controller
{
$data = $request->getAll();
$currency = $this->currencyRepository->findNull($data['transaction_currency_id']);
if (null === $currency) {
$this->currencyRepository->findByCodeNull($data['transaction_currency_code']);
}
if (null === $currency) {
throw new FireflyException('Could not find the indicated currency.');
}

View File

@@ -175,8 +175,7 @@ class JournalLinkController extends Controller
$data['direction'] = 'inward';
$journalLink = $this->repository->storeLink($data, $inward, $outward);
$resource = new Item($journalLink, new JournalLinkTransformer($this->parameters), 'journal_links');
$resource = new Item($journalLink, new JournalLinkTransformer($this->parameters), 'journal_links');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');