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 { photoId } = await params;
const photo = await getPhotoNoStore(photoId, true);
if (!photo) { redirect(PATH_ADMIN); }
const [ const [
photo,
uniqueTags, uniqueTags,
uniqueRecipes, uniqueRecipes,
uniqueFilms, uniqueFilms,
] = await Promise.all([ ] = await Promise.all([
getPhotoNoStore(photoId, true),
getUniqueTagsCached(), getUniqueTagsCached(),
getUniqueRecipesCached(), getUniqueRecipesCached(),
getUniqueFilmsCached(), getUniqueFilmsCached(),
]); ]);
if (!photo) { redirect(PATH_ADMIN); }
const hasAiTextGeneration = AI_TEXT_GENERATION_ENABLED; const hasAiTextGeneration = AI_TEXT_GENERATION_ENABLED;
// Only generate image thumbnails when AI generation is enabled // Only generate image thumbnails when AI generation is enabled