Update getPhoto action signatures

This commit is contained in:
Sam Becker 2024-05-12 15:27:15 -05:00
parent ac3b71142e
commit 33469a60ee
2 changed files with 7 additions and 6 deletions

View File

@ -58,12 +58,12 @@ export default function InfinitePhotoScroll({
? getPhotosCachedAction( ? getPhotosCachedAction(
initialOffset + size * itemsPerPage, initialOffset + size * itemsPerPage,
itemsPerPage, itemsPerPage,
includeHiddenPhotos, includeHiddenPhotos ? 'include' : 'exclude',
) )
: getPhotosAction( : getPhotosAction(
initialOffset + size * itemsPerPage, initialOffset + size * itemsPerPage,
itemsPerPage, itemsPerPage,
includeHiddenPhotos, includeHiddenPhotos ? 'include' : 'exclude',
) )
, [useCachedPhotos, initialOffset, itemsPerPage, includeHiddenPhotos]); , [useCachedPhotos, initialOffset, itemsPerPage, includeHiddenPhotos]);

View File

@ -1,6 +1,7 @@
'use server'; 'use server';
import { import {
GetPhotosOptions,
sqlDeletePhoto, sqlDeletePhoto,
sqlInsertPhoto, sqlInsertPhoto,
sqlDeletePhotoTagGlobally, sqlDeletePhotoTagGlobally,
@ -201,16 +202,16 @@ export const getImageBlurAction = async (url: string) =>
export const getPhotosAction = async ( export const getPhotosAction = async (
offset: number, offset: number,
limit: number, limit: number,
includeHidden?: boolean, hidden?: GetPhotosOptions['hidden'],
) => ) =>
getPhotos({ offset, includeHidden, limit }); getPhotos({ offset, hidden, limit });
export const getPhotosCachedAction = async ( export const getPhotosCachedAction = async (
offset: number, offset: number,
limit: number, limit: number,
includeHidden?: boolean, hidden?: GetPhotosOptions['hidden'],
) => ) =>
getPhotosCachedCached({ offset, includeHidden, limit }); getPhotosCachedCached({ offset, hidden, limit });
export const queryPhotosByTitleAction = async (query: string) => export const queryPhotosByTitleAction = async (query: string) =>
(await getPhotos({ query, limit: 10 })) (await getPhotos({ query, limit: 10 }))