Optimize photo edit network request

This commit is contained in:
Sam Becker 2025-03-31 00:27:54 -05:00
parent 5f992788f2
commit c94e641627

View File

@ -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