mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 08:30:06 +00:00
Code cleanup.
This commit is contained in:
@@ -46,8 +46,6 @@ class ShowController extends Controller
|
||||
public const string RESOURCE_KEY = 'webhooks';
|
||||
private WebhookRepositoryInterface $repository;
|
||||
|
||||
/**
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
@@ -67,7 +65,6 @@ class ShowController extends Controller
|
||||
*
|
||||
* Display a listing of the webhooks of the user.
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function index(): JsonResponse
|
||||
@@ -80,7 +77,7 @@ class ShowController extends Controller
|
||||
|
||||
// make paginator:
|
||||
$paginator = new LengthAwarePaginator($webhooks, $count, $pageSize, $this->parameters->get('page'));
|
||||
$paginator->setPath(route('api.v1.webhooks.index') . $this->buildParams());
|
||||
$paginator->setPath(route('api.v1.webhooks.index').$this->buildParams());
|
||||
|
||||
/** @var WebhookTransformer $transformer */
|
||||
$transformer = app(WebhookTransformer::class);
|
||||
@@ -97,10 +94,6 @@ class ShowController extends Controller
|
||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/webhooks/getWebhook
|
||||
*
|
||||
* Show single instance.
|
||||
*
|
||||
* @param Webhook $webhook
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function show(Webhook $webhook): JsonResponse
|
||||
{
|
||||
@@ -119,15 +112,11 @@ class ShowController extends Controller
|
||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/webhooks/triggerWebhookTransaction
|
||||
*
|
||||
* This method recycles part of the code of the StoredGroupEventHandler.
|
||||
*
|
||||
* @param Webhook $webhook
|
||||
* @param TransactionGroup $group
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function triggerTransaction(Webhook $webhook, TransactionGroup $group): JsonResponse
|
||||
{
|
||||
app('log')->debug(sprintf('Now in triggerTransaction(%d, %d)', $webhook->id, $group->id));
|
||||
|
||||
/** @var MessageGeneratorInterface $engine */
|
||||
$engine = app(MessageGeneratorInterface::class);
|
||||
$engine->setUser(auth()->user());
|
||||
|
||||
Reference in New Issue
Block a user