Fix double loading of data

This commit is contained in:
Daniel Pupius
2025-04-24 10:51:50 -07:00
parent 5ba6899c94
commit 28cb7072f7
4 changed files with 4 additions and 39 deletions
-16
View File
@@ -16,22 +16,6 @@ export interface ApiResponse<T> {
error?: string;
}
/**
* Fetch a list of the most recent packets from the server
*/
export async function fetchRecentPackets(): Promise<ApiResponse<Packet[]>> {
try {
const response = await fetch(API_ENDPOINTS.RECENT_PACKETS);
if (!response.ok) {
throw new Error(`Error: ${response.status} ${response.statusText}`);
}
const data = await response.json();
return { data };
} catch (error) {
return { error: error instanceof Error ? error.message : String(error) };
}
}
// Re-export types
export type {
InfoEvent,
-1
View File
@@ -26,5 +26,4 @@ export const API_BASE_URL = getApiBaseUrl();
// API endpoints
export const API_ENDPOINTS = {
STREAM: `${API_BASE_URL}/api/stream`,
RECENT_PACKETS: `${API_BASE_URL}/api/packets/recent`,
};