Skip to content

Commit

Permalink
Fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Destiner committed May 15, 2024
1 parent c0c2fea commit 8492fa6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/og.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ export default function handler(request: VercelRequest): Response {
}
const { searchParams } = new URL(request.url);
const address = searchParams.get('address');
const label = addresses[address];
if (!address) {
return new Response(`Failed to generate the image`, {
status: 400,
});
}
const label = (addresses as Record<string, string>)[address];

if (!address || !isAddress(address)) {
return new ImageResponse(
(
// @ts-ignore
<div
style={{
display: 'flex',
Expand Down Expand Up @@ -70,6 +76,7 @@ export default function handler(request: VercelRequest): Response {

return new ImageResponse(
(
// @ts-ignore
<div
style={{
display: 'flex',
Expand Down

0 comments on commit 8492fa6

Please sign in to comment.