From 33469a60ee98eabeea726191f3a78ebbf0c54837 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sun, 12 May 2024 15:27:15 -0500 Subject: [PATCH] Update getPhoto action signatures --- src/photo/InfinitePhotoScroll.tsx | 4 ++-- src/photo/actions.ts | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/photo/InfinitePhotoScroll.tsx b/src/photo/InfinitePhotoScroll.tsx index 64cf4df8..4c221e18 100644 --- a/src/photo/InfinitePhotoScroll.tsx +++ b/src/photo/InfinitePhotoScroll.tsx @@ -58,12 +58,12 @@ export default function InfinitePhotoScroll({ ? getPhotosCachedAction( initialOffset + size * itemsPerPage, itemsPerPage, - includeHiddenPhotos, + includeHiddenPhotos ? 'include' : 'exclude', ) : getPhotosAction( initialOffset + size * itemsPerPage, itemsPerPage, - includeHiddenPhotos, + includeHiddenPhotos ? 'include' : 'exclude', ) , [useCachedPhotos, initialOffset, itemsPerPage, includeHiddenPhotos]); diff --git a/src/photo/actions.ts b/src/photo/actions.ts index f2d190dc..e1e09d11 100644 --- a/src/photo/actions.ts +++ b/src/photo/actions.ts @@ -1,6 +1,7 @@ 'use server'; import { + GetPhotosOptions, sqlDeletePhoto, sqlInsertPhoto, sqlDeletePhotoTagGlobally, @@ -201,16 +202,16 @@ export const getImageBlurAction = async (url: string) => export const getPhotosAction = async ( offset: number, limit: number, - includeHidden?: boolean, + hidden?: GetPhotosOptions['hidden'], ) => - getPhotos({ offset, includeHidden, limit }); + getPhotos({ offset, hidden, limit }); export const getPhotosCachedAction = async ( offset: number, limit: number, - includeHidden?: boolean, + hidden?: GetPhotosOptions['hidden'], ) => - getPhotosCachedCached({ offset, includeHidden, limit }); + getPhotosCachedCached({ offset, hidden, limit }); export const queryPhotosByTitleAction = async (query: string) => (await getPhotos({ query, limit: 10 }))