Merge branch 'main' into static

This commit is contained in:
Sam Becker 2024-03-14 13:03:41 -05:00
commit e68bac3630
2 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ export default function AdminPhotoMenuClient({
const path = usePathname();
const shouldRedirectFav = isPathFavs(path) && isFav;
const shouldRedirectDelete = pathForPhoto(photo.id) === path;
return (
<>
<MoreMenu {...{

View File

@ -76,7 +76,7 @@ export async function toggleFavoritePhotoAction(
await sqlUpdatePhoto(convertPhotoToPhotoDbInsert(photo));
revalidateAllKeysAndPaths();
if (shouldRedirect) {
redirect(PATH_ROOT);
redirect(pathForPhoto(photoId));
}
}
}