Merge branch 'main' into static

This commit is contained in:
Sam Becker 2024-02-19 10:12:04 -06:00
commit d0ac2fbbe7

View File

@ -75,10 +75,7 @@ export async function deletePhotoAction(
photoUrl: string,
shouldRedirect?: boolean,
) {
await Promise.all([
deleteStorageUrl(photoUrl),
sqlDeletePhoto(photoId),
]);
await sqlDeletePhoto(photoId).then(() => deleteStorageUrl(photoUrl));
revalidateAllKeysAndPaths();
if (shouldRedirect) {
redirect(PATH_ROOT);
@ -87,8 +84,8 @@ export async function deletePhotoAction(
export async function deletePhotoFormAction(formData: FormData) {
return deletePhotoAction(
formData.get('url') as string,
formData.get('id') as string,
formData.get('url') as string,
);
};