From 5e0a088d4fe43d0e87e348aa359153054379574a Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Tue, 19 Sep 2023 19:08:14 -0500 Subject: [PATCH] Add explicit return types to image response routes --- src/app/(static)/home-image/route.tsx | 2 +- src/app/(static)/p/[photoId]/image/route.tsx | 5 ++++- src/app/(static)/t/[tag]/image/route.tsx | 5 ++++- src/app/(static)/template-image-tight/route.tsx | 2 +- src/app/(static)/template-image/route.tsx | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/app/(static)/home-image/route.tsx b/src/app/(static)/home-image/route.tsx index b0d35fcc..50167334 100644 --- a/src/app/(static)/home-image/route.tsx +++ b/src/app/(static)/home-image/route.tsx @@ -10,7 +10,7 @@ import { ImageResponse } from '@vercel/og'; export const runtime = 'edge'; -export async function GET(request: Request) { +export async function GET(request: Request): Promise { const photos = await getPhotos( undefined, MAX_PHOTOS_TO_SHOW_HOME, diff --git a/src/app/(static)/p/[photoId]/image/route.tsx b/src/app/(static)/p/[photoId]/image/route.tsx index b6a34116..132bfeb3 100644 --- a/src/app/(static)/p/[photoId]/image/route.tsx +++ b/src/app/(static)/p/[photoId]/image/route.tsx @@ -8,7 +8,10 @@ import { ImageResponse } from '@vercel/og'; export const runtime = 'edge'; -export async function GET(request: Request, context: any) { +export async function GET( + request: Request, + context: any, +): Promise { const photo = await getPhoto(context.params.photoId); const { diff --git a/src/app/(static)/t/[tag]/image/route.tsx b/src/app/(static)/t/[tag]/image/route.tsx index 8a5facce..35a5ab50 100644 --- a/src/app/(static)/t/[tag]/image/route.tsx +++ b/src/app/(static)/t/[tag]/image/route.tsx @@ -11,7 +11,10 @@ import { ImageResponse } from '@vercel/og'; export const runtime = 'edge'; -export async function GET(request: Request, context: any) { +export async function GET( + request: Request, + context: any, +): Promise { const photos = await getPhotos( undefined, MAX_PHOTOS_TO_SHOW_PER_TAG, diff --git a/src/app/(static)/template-image-tight/route.tsx b/src/app/(static)/template-image-tight/route.tsx index 1854305c..69ce1310 100644 --- a/src/app/(static)/template-image-tight/route.tsx +++ b/src/app/(static)/template-image-tight/route.tsx @@ -12,7 +12,7 @@ import { ImageResponse } from '@vercel/og'; export const runtime = 'edge'; -export async function GET(request: Request) { +export async function GET(request: Request): Promise { const photos = await getPhotos('priority', MAX_PHOTOS_TO_SHOW_TEMPLATE_TIGHT); const { diff --git a/src/app/(static)/template-image/route.tsx b/src/app/(static)/template-image/route.tsx index 1ce81dfa..725b5d25 100644 --- a/src/app/(static)/template-image/route.tsx +++ b/src/app/(static)/template-image/route.tsx @@ -12,7 +12,7 @@ import { ImageResponse } from '@vercel/og'; export const runtime = 'edge'; -export async function GET(request: Request) { +export async function GET(request: Request): Promise { const photos = await getPhotos('priority', MAX_PHOTOS_TO_SHOW_TEMPLATE); const { fontFamily,