mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-22 00:47:24 -06:00
Fix #2752
This commit is contained in:
parent
3e40a6cf3d
commit
50d3c36b6a
@ -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.
|
||||
*
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user