Merge branch 'main' into cmdk
This commit is contained in:
commit
fdf53111cf
@ -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,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user