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:
parent
e56dcb9e60
commit
7f05374dd5
1 changed files with 3 additions and 3 deletions
|
|
@ -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,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue