mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 02:36:28 +00:00 
			
		
		
		
	Code for #782
This commit is contained in:
		| @@ -50,6 +50,20 @@ class AutoCompleteController extends Controller | ||||
|  | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param JournalCollectorInterface $collector | ||||
|      * | ||||
|      * @return \Illuminate\Http\JsonResponse | ||||
|      */ | ||||
|     public function allTransactionJournals(JournalCollectorInterface $collector) | ||||
|     { | ||||
|         $collector->setLimit(250)->setPage(1); | ||||
|         $return = array_unique($collector->getJournals()->pluck('description')->toArray()); | ||||
|         sort($return); | ||||
|  | ||||
|         return Response::json($return); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Returns a JSON list of all beneficiaries. | ||||
|      * | ||||
| @@ -134,4 +148,22 @@ class AutoCompleteController extends Controller | ||||
|         return Response::json($return); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param JournalCollectorInterface $collector | ||||
|      * @param string                    $what | ||||
|      * | ||||
|      * @return \Illuminate\Http\JsonResponse | ||||
|      */ | ||||
|     public function transactionJournals(JournalCollectorInterface $collector, string $what) | ||||
|     { | ||||
|         $type  = config('firefly.transactionTypesByWhat.' . $what); | ||||
|         $types = [$type]; | ||||
|  | ||||
|         $collector->setTypes($types)->setLimit(250)->setPage(1); | ||||
|         $return = array_unique($collector->getJournals()->pluck('description')->toArray()); | ||||
|         sort($return); | ||||
|  | ||||
|         return Response::json($return); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -16,9 +16,7 @@ namespace FireflyIII\Http\Controllers; | ||||
| use Amount; | ||||
| use Carbon\Carbon; | ||||
| use FireflyIII\Helpers\Collector\JournalCollectorInterface; | ||||
| use FireflyIII\Models\AccountType; | ||||
| use FireflyIII\Models\TransactionType; | ||||
| use FireflyIII\Repositories\Account\AccountRepositoryInterface; | ||||
| use FireflyIII\Repositories\Bill\BillRepositoryInterface; | ||||
| use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; | ||||
| use FireflyIII\Repositories\Category\CategoryRepositoryInterface; | ||||
| @@ -62,22 +60,6 @@ class JsonController extends Controller | ||||
|         return Response::json(['html' => $view]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param JournalCollectorInterface $collector | ||||
|      * | ||||
|      * @return \Illuminate\Http\JsonResponse | ||||
|      */ | ||||
|     public function allTransactionJournals(JournalCollectorInterface $collector) | ||||
|     { | ||||
|         $collector->setLimit(100)->setPage(1); | ||||
|         $return = array_unique($collector->getJournals()->pluck('description')->toArray()); | ||||
|         sort($return); | ||||
|  | ||||
|         return Response::json($return); | ||||
|  | ||||
|  | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param BillRepositoryInterface $repository | ||||
|      * | ||||
| @@ -230,26 +212,6 @@ class JsonController extends Controller | ||||
|  | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param JournalCollectorInterface $collector | ||||
|      * @param string                    $what | ||||
|      * | ||||
|      * @return \Illuminate\Http\JsonResponse | ||||
|      */ | ||||
|     public function transactionJournals(JournalCollectorInterface $collector, string $what) | ||||
|     { | ||||
|         $type  = config('firefly.transactionTypesByWhat.' . $what); | ||||
|         $types = [$type]; | ||||
|  | ||||
|         $collector->setTypes($types)->setLimit(100)->setPage(1); | ||||
|         $return = array_unique($collector->getJournals()->pluck('description')->toArray()); | ||||
|         sort($return); | ||||
|  | ||||
|         return Response::json($return); | ||||
|  | ||||
|  | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param JournalRepositoryInterface $repository | ||||
|      * | ||||
|   | ||||
		Reference in New Issue
	
	Block a user