From 2b54dd781ce6840b0d38e386d899bf764212cc18 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sun, 6 Jul 2025 11:27:36 -0500 Subject: [PATCH] Revalidate paths after individual upload adds --- src/photo/actions.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/photo/actions.ts b/src/photo/actions.ts index 5151a45c..5f43f56c 100644 --- a/src/photo/actions.ts +++ b/src/photo/actions.ts @@ -99,6 +99,7 @@ const addUpload = async ({ takenAtNaiveLocal, onStreamUpdate, onFinish, + shouldRevalidateAllKeysAndPaths, }:{ url: string title?: string @@ -113,6 +114,7 @@ const addUpload = async ({ status?: UrlAddStatus['status'], ) => void onFinish?: (url: string) => void + shouldRevalidateAllKeysAndPaths?: boolean }) => { const { formDataFromExif, @@ -171,6 +173,9 @@ const addUpload = async ({ await convertFormDataToPhotoDbInsertAndLookupRecipeTitle(form); photo.url = updatedUrl; await insertPhoto(photo); + if (shouldRevalidateAllKeysAndPaths) { + after(revalidateAllKeysAndPaths); + } onFinish?.(url); // Re-submit with updated url onStreamUpdate?.(subheadFinal, 'added');