Skip to content

Commit

Permalink
Patch POAP API Availability
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemans committed Mar 3, 2024
1 parent 40e5a6b commit 490e61f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions hooks/usePOAPData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ export type POAPMetadata = {
export const usePOAPData = async (
poapEventId: number
): Promise<POAPMetadata | undefined> => {
const request = await fetch(`${POAP_API_HOST}/metadata/${poapEventId}/1`);
try {
const request = await fetch(`${POAP_API_HOST}/metadata/${poapEventId}/1`);

if (!request.ok) return;
if (!request.ok) return;

return await request.json();
return await request.json();
} catch (erorr) {
console.error('Error fetching POAP data', erorr);
}
};

0 comments on commit 490e61f

Please sign in to comment.