From 7f05374dd53576707561ceb87e954a3c5c2aba27 Mon Sep 17 00:00:00 2001 From: padreug Date: Tue, 5 Aug 2025 00:06:29 +0200 Subject: [PATCH] refactor: Update fetchEvents function to use public endpoint - Change fetchEvents to access the new public endpoint for retrieving events without authentication. - Remove the allWallets parameter and the API key from the request headers for simplified access. --- src/lib/api/events.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/api/events.ts b/src/lib/api/events.ts index f1ca2ee..3c6d7ea 100644 --- a/src/lib/api/events.ts +++ b/src/lib/api/events.ts @@ -10,14 +10,14 @@ interface ApiError { detail: string | Array<{ loc: [string, number]; msg: string; type: string }> } -export async function fetchEvents(allWallets = true): Promise { +export async function fetchEvents(): Promise { try { + // Use the new public endpoint that allows access to all events without authentication const response = await fetch( - `${API_BASE_URL}/events/api/v1/events?all_wallets=${allWallets}`, + `${API_BASE_URL}/events/api/v1/events/public`, { headers: { 'accept': 'application/json', - 'X-API-KEY': API_KEY, }, } )