Frontend updates: caching basic data (json) from CDragon
Implement caching in the patch_detector, consume the cache from API routes in frontend
This commit is contained in:
@@ -7,15 +7,12 @@ const props = defineProps<{
|
||||
error?: boolean
|
||||
}>()
|
||||
|
||||
// Constants
|
||||
const ITEMS_API_URL = CDRAGON_BASE + 'plugins/rcp-be-lol-game-data/global/default/v1/items.json'
|
||||
|
||||
// State
|
||||
// State - use cached API endpoint instead of direct CDragon fetch
|
||||
const {
|
||||
data: items,
|
||||
pending: loadingItems,
|
||||
error: itemsError
|
||||
} = useFetch(ITEMS_API_URL, {
|
||||
} = useFetch('/api/cdragon/items', {
|
||||
lazy: true, // Don't block rendering
|
||||
server: false // Client-side only
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user