Clean up and fix API routes.

This commit is contained in:
James Cole
2023-02-12 06:53:36 +01:00
parent f82a884783
commit 7225474621
139 changed files with 275 additions and 373 deletions

View File

@@ -59,7 +59,7 @@ class DestroyController extends Controller
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/#/rules/deleteRule
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rules/deleteRule
*
* Delete the resource.
*

View File

@@ -1,62 +0,0 @@
<?php
/*
* ListController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Rule;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Rule\RuleRepositoryInterface;
use FireflyIII\User;
/**
* Class ListController
*/
class ListController extends Controller
{
private AccountRepositoryInterface $accountRepository;
private RuleRepositoryInterface $ruleRepository;
/**
* RuleController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->ruleRepository = app(RuleRepositoryInterface::class);
$this->ruleRepository->setUser($user);
$this->accountRepository = app(AccountRepositoryInterface::class);
$this->accountRepository->setUser($user);
return $next($request);
}
);
}
}

View File

@@ -65,7 +65,7 @@ class ShowController extends Controller
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/#/rules/listRule
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rules/listRule
*
* List all of them.
*
@@ -101,7 +101,7 @@ class ShowController extends Controller
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/#/rules/getRule
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rules/getRule
*
* List single resource.
*

View File

@@ -61,7 +61,7 @@ class StoreController extends Controller
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/#/rules/storeRule
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rules/storeRule
*
* Store new object.
*

View File

@@ -67,7 +67,7 @@ class TriggerController extends Controller
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/#/rules/testRule
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rules/testRule
*
* @param TestRequest $request
* @param Rule $rule
@@ -117,7 +117,7 @@ class TriggerController extends Controller
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/#/rules/fireRule
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rules/fireRule
*
* Execute the given rule group on a set of existing transactions.
*

View File

@@ -62,7 +62,7 @@ class UpdateController extends Controller
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/#/rules/updateRule
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rules/updateRule
*
* Update a rule.
*