Merge branch 'main' into cmdk

This commit is contained in:
Sam Becker 2024-02-19 10:11:54 -06:00
commit fdf53111cf

View File

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