This commit is contained in:
James Cole 2019-10-21 18:32:13 +02:00
parent 3e40a6cf3d
commit 50d3c36b6a
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 24 additions and 0 deletions

View File

@ -251,6 +251,19 @@ class TransactionController extends Controller
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Show a single transaction, by transaction journal.
*
* @param TransactionJournal $transactionJournal
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function showByJournal(TransactionJournal $transactionJournal): JsonResponse
{
return $this->show($transactionJournal->transactionGroup);
}
/**
* Store a new transaction.
*

View File

@ -424,6 +424,17 @@ Route::group(
}
);
// special group for transaction journals
Route::group(
['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'journals',
'as' => 'api.v1.journals.'],
static function () {
// Transaction API routes:
Route::get('{tj}', ['uses' => 'TransactionController@showByJournal', 'as' => 'showByJournal']);
}
);
Route::group(
['middleware' => ['auth:api', 'bindings', \FireflyIII\Http\Middleware\IsAdmin::class], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'users',