From c94e64162788ce5ab72cfc6ca285a291089a5acc Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Mon, 31 Mar 2025 00:27:54 -0500 Subject: [PATCH] Optimize photo edit network request --- app/admin/photos/[photoId]/edit/page.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/admin/photos/[photoId]/edit/page.tsx b/app/admin/photos/[photoId]/edit/page.tsx index 1cf889f0..38dda275 100644 --- a/app/admin/photos/[photoId]/edit/page.tsx +++ b/app/admin/photos/[photoId]/edit/page.tsx @@ -22,20 +22,20 @@ export default async function PhotoEditPage({ }) { const { photoId } = await params; - const photo = await getPhotoNoStore(photoId, true); - - if (!photo) { redirect(PATH_ADMIN); } - const [ + photo, uniqueTags, uniqueRecipes, uniqueFilms, ] = await Promise.all([ + getPhotoNoStore(photoId, true), getUniqueTagsCached(), getUniqueRecipesCached(), getUniqueFilmsCached(), ]); + if (!photo) { redirect(PATH_ADMIN); } + const hasAiTextGeneration = AI_TEXT_GENERATION_ENABLED; // Only generate image thumbnails when AI generation is enabled