From 2dee2f56b97409b8b8eff7c0c2cba9cf426d5f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Cmit=20Tun=C3=A7?= Date: Fri, 17 Jan 2025 23:33:02 +0300 Subject: [PATCH] Refactor API routes for currency and gold rates - Commented out the '/run-all-fetchs' endpoint to prevent its usage while maintaining the '/today.json' endpoint for fetching all rates. - Rearranged the '/gold-rates' endpoint to ensure it is defined after the '/currency-rates' endpoints for better organization. - Ensured all existing endpoints for currency and gold rates remain functional, enhancing the API's structure and maintainability. These changes improve the clarity and organization of the API routes, facilitating better management of financial data. --- routes/api.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/routes/api.php b/routes/api.php index 0308128..c560ee5 100644 --- a/routes/api.php +++ b/routes/api.php @@ -10,9 +10,12 @@ use App\Http\Controllers\CurrencyController; |-------------------------------------------------------------------------- */ -Route::get('/run-all-fetchs', [CurrencyController::class, 'runAllFetchs']); +//Route::get('/run-all-fetchs', [CurrencyController::class, 'runAllFetchs']); + Route::get('/today.json', [CurrencyController::class, 'getAllRates']); + Route::get('/currency-rates', [CurrencyController::class, 'getCurrentRates']); -Route::get('/gold-rates', [CurrencyController::class, 'getGoldRates']); Route::get('/currency-rates/{currencyName}', [CurrencyController::class, 'getCurrencyRateByName']); + +Route::get('/gold-rates', [CurrencyController::class, 'getGoldRates']); Route::get('/gold-rates/{goldName}', [CurrencyController::class, 'getGoldRateByName']); \ No newline at end of file