fixed some navigation issues
This commit is contained in:
@@ -112,15 +112,14 @@ export const rommApiClient = {
|
||||
},
|
||||
|
||||
async fetchRecentGames(): Promise<Game[]> {
|
||||
// Ordering by internal id desc is functionally identical to created_at logic natively
|
||||
const res = await fetch(`${this.apiBase}/roms?limit=20&order_by=id&order_dir=desc`, { headers: this.headers });
|
||||
const res = await fetch(`${this.apiBase}/roms?limit=50&order_by=id&order_dir=desc`, { headers: this.headers });
|
||||
if (!res.ok) throw new Error('Failed to fetch recents.');
|
||||
const json = await res.json();
|
||||
return json.items ? json.items.map(mapRomToGame) : [];
|
||||
},
|
||||
|
||||
async fetchFavorites(): Promise<Game[]> {
|
||||
const res = await fetch(`${this.apiBase}/roms?favorite=true&limit=20`, { headers: this.headers });
|
||||
const res = await fetch(`${this.apiBase}/roms?favorite=true&limit=50`, { headers: this.headers });
|
||||
if (!res.ok) throw new Error('Failed to fetch favorites.');
|
||||
const json = await res.json();
|
||||
return json.items ? json.items.map(mapRomToGame) : [];
|
||||
|
||||
Reference in New Issue
Block a user