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.
This commit is contained in:
padreug 2025-08-05 00:06:29 +02:00
parent e56dcb9e60
commit 7f05374dd5

View file

@ -10,14 +10,14 @@ interface ApiError {
detail: string | Array<{ loc: [string, number]; msg: string; type: string }>
}
export async function fetchEvents(allWallets = true): Promise<Event[]> {
export async function fetchEvents(): Promise<Event[]> {
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,
},
}
)