From 00fb809ab97821491a4b6eda449393f6093c5d42 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 8 Dec 2018 08:22:34 +0100 Subject: [PATCH] Remove include parameter. --- app/Api/V1/Controllers/AccountController.php | 5 ----- app/Api/V1/Controllers/AttachmentController.php | 5 ----- .../V1/Controllers/AvailableBudgetController.php | 6 ------ app/Api/V1/Controllers/BillController.php | 4 ---- app/Api/V1/Controllers/BudgetController.php | 4 ---- app/Api/V1/Controllers/BudgetLimitController.php | 5 ----- app/Api/V1/Controllers/CategoryController.php | 4 ---- app/Api/V1/Controllers/CurrencyController.php | 4 ---- app/Api/V1/Controllers/LinkTypeController.php | 5 ----- app/Api/V1/Controllers/PiggyBankController.php | 4 ---- app/Api/V1/Controllers/RecurrenceController.php | 4 ---- app/Api/V1/Controllers/RuleGroupController.php | 4 ---- app/Api/V1/Controllers/TagController.php | 4 ---- .../V1/Controllers/TransactionLinkController.php | 16 ---------------- 14 files changed, 74 deletions(-) diff --git a/app/Api/V1/Controllers/AccountController.php b/app/Api/V1/Controllers/AccountController.php index 0ef123c71f..937858d797 100644 --- a/app/Api/V1/Controllers/AccountController.php +++ b/app/Api/V1/Controllers/AccountController.php @@ -136,11 +136,6 @@ class AccountController extends Controller public function show(Request $request, Account $account): JsonResponse { $manager = new Manager; - - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); $resource = new Item($account, new AccountTransformer($this->parameters), 'accounts'); diff --git a/app/Api/V1/Controllers/AttachmentController.php b/app/Api/V1/Controllers/AttachmentController.php index 947691f2c0..6b1159a4b3 100644 --- a/app/Api/V1/Controllers/AttachmentController.php +++ b/app/Api/V1/Controllers/AttachmentController.php @@ -161,11 +161,6 @@ class AttachmentController extends Controller public function show(Request $request, Attachment $attachment): JsonResponse { $manager = new Manager; - - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); $resource = new Item($attachment, new AttachmentTransformer($this->parameters), 'attachments'); diff --git a/app/Api/V1/Controllers/AvailableBudgetController.php b/app/Api/V1/Controllers/AvailableBudgetController.php index 13c56f1495..49d2fed969 100644 --- a/app/Api/V1/Controllers/AvailableBudgetController.php +++ b/app/Api/V1/Controllers/AvailableBudgetController.php @@ -127,13 +127,7 @@ class AvailableBudgetController extends Controller */ public function show(Request $request, AvailableBudget $availableBudget): JsonResponse { - $manager = new Manager; - - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); $resource = new Item($availableBudget, new AvailableBudgetTransformer($this->parameters), 'available_budgets'); diff --git a/app/Api/V1/Controllers/BillController.php b/app/Api/V1/Controllers/BillController.php index 4f438df8b9..234e311eef 100644 --- a/app/Api/V1/Controllers/BillController.php +++ b/app/Api/V1/Controllers/BillController.php @@ -117,10 +117,6 @@ class BillController extends Controller public function show(Request $request, Bill $bill): JsonResponse { $manager = new Manager(); - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); diff --git a/app/Api/V1/Controllers/BudgetController.php b/app/Api/V1/Controllers/BudgetController.php index 68409008c2..1f6937fcfa 100644 --- a/app/Api/V1/Controllers/BudgetController.php +++ b/app/Api/V1/Controllers/BudgetController.php @@ -127,10 +127,6 @@ class BudgetController extends Controller public function show(Request $request, Budget $budget): JsonResponse { $manager = new Manager(); - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); diff --git a/app/Api/V1/Controllers/BudgetLimitController.php b/app/Api/V1/Controllers/BudgetLimitController.php index 99127989cb..f99adc2933 100644 --- a/app/Api/V1/Controllers/BudgetLimitController.php +++ b/app/Api/V1/Controllers/BudgetLimitController.php @@ -130,11 +130,6 @@ class BudgetLimitController extends Controller public function show(Request $request, BudgetLimit $budgetLimit): JsonResponse { $manager = new Manager; - - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); $resource = new Item($budgetLimit, new BudgetLimitTransformer($this->parameters), 'budget_limits'); diff --git a/app/Api/V1/Controllers/CategoryController.php b/app/Api/V1/Controllers/CategoryController.php index 42e11acd79..8d4dc85e01 100644 --- a/app/Api/V1/Controllers/CategoryController.php +++ b/app/Api/V1/Controllers/CategoryController.php @@ -127,10 +127,6 @@ class CategoryController extends Controller public function show(Request $request, Category $category): JsonResponse { $manager = new Manager(); - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); diff --git a/app/Api/V1/Controllers/CurrencyController.php b/app/Api/V1/Controllers/CurrencyController.php index f8058932ca..803ed146dd 100644 --- a/app/Api/V1/Controllers/CurrencyController.php +++ b/app/Api/V1/Controllers/CurrencyController.php @@ -140,10 +140,6 @@ class CurrencyController extends Controller public function show(Request $request, TransactionCurrency $currency): JsonResponse { $manager = new Manager(); - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); $defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user()); diff --git a/app/Api/V1/Controllers/LinkTypeController.php b/app/Api/V1/Controllers/LinkTypeController.php index c7e525028e..6ad7a937df 100644 --- a/app/Api/V1/Controllers/LinkTypeController.php +++ b/app/Api/V1/Controllers/LinkTypeController.php @@ -139,11 +139,6 @@ class LinkTypeController extends Controller public function show(Request $request, LinkType $linkType): JsonResponse { $manager = new Manager; - - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); $resource = new Item($linkType, new LinkTypeTransformer($this->parameters), 'link_types'); diff --git a/app/Api/V1/Controllers/PiggyBankController.php b/app/Api/V1/Controllers/PiggyBankController.php index f5283a2a42..7b1917030d 100644 --- a/app/Api/V1/Controllers/PiggyBankController.php +++ b/app/Api/V1/Controllers/PiggyBankController.php @@ -161,10 +161,6 @@ class PiggyBankController extends Controller public function show(Request $request, PiggyBank $piggyBank): JsonResponse { $manager = new Manager(); - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); diff --git a/app/Api/V1/Controllers/RecurrenceController.php b/app/Api/V1/Controllers/RecurrenceController.php index 4df3bfd22c..31a267e79c 100644 --- a/app/Api/V1/Controllers/RecurrenceController.php +++ b/app/Api/V1/Controllers/RecurrenceController.php @@ -134,10 +134,6 @@ class RecurrenceController extends Controller public function show(Request $request, Recurrence $recurrence): JsonResponse { $manager = new Manager(); - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); diff --git a/app/Api/V1/Controllers/RuleGroupController.php b/app/Api/V1/Controllers/RuleGroupController.php index 1f1f5a15dd..6552e97b90 100644 --- a/app/Api/V1/Controllers/RuleGroupController.php +++ b/app/Api/V1/Controllers/RuleGroupController.php @@ -173,10 +173,6 @@ class RuleGroupController extends Controller public function show(Request $request, RuleGroup $ruleGroup): JsonResponse { $manager = new Manager(); - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); diff --git a/app/Api/V1/Controllers/TagController.php b/app/Api/V1/Controllers/TagController.php index f916217001..2b5fd7d3e6 100644 --- a/app/Api/V1/Controllers/TagController.php +++ b/app/Api/V1/Controllers/TagController.php @@ -131,10 +131,6 @@ class TagController extends Controller public function show(Request $request, Tag $tag): JsonResponse { $manager = new Manager(); - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); diff --git a/app/Api/V1/Controllers/TransactionLinkController.php b/app/Api/V1/Controllers/TransactionLinkController.php index 708a2a7f69..2352414f53 100644 --- a/app/Api/V1/Controllers/TransactionLinkController.php +++ b/app/Api/V1/Controllers/TransactionLinkController.php @@ -137,11 +137,6 @@ class TransactionLinkController extends Controller public function show(Request $request, TransactionJournalLink $journalLink): JsonResponse { $manager = new Manager; - - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $baseUrl = $request->getSchemeAndHttpHost() . '/api/v1'; $manager->setSerializer(new JsonApiSerializer($baseUrl)); $resource = new Item($journalLink, new JournalLinkTransformer($this->parameters), 'transaction_links'); @@ -161,11 +156,6 @@ class TransactionLinkController extends Controller public function store(JournalLinkRequest $request): JsonResponse { $manager = new Manager; - - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - $data = $request->getAll(); $inward = $this->journalRepository->findNull($data['inward_id'] ?? 0); $outward = $this->journalRepository->findNull($data['outward_id'] ?? 0); @@ -193,12 +183,6 @@ class TransactionLinkController extends Controller public function update(JournalLinkRequest $request, TransactionJournalLink $journalLink): JsonResponse { $manager = new Manager; - - // add include parameter: - $include = $request->get('include') ?? ''; - $manager->parseIncludes($include); - - $data = $request->getAll(); $data['inward'] = $this->journalRepository->findNull($data['inward_id'] ?? 0); $data['outward'] = $this->journalRepository->findNull($data['outward_id'] ?? 0);