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(
initialOffset + size * itemsPerPage,
itemsPerPage,
includeHiddenPhotos,
includeHiddenPhotos ? 'include' : 'exclude',
)
: getPhotosAction(
initialOffset + size * itemsPerPage,
itemsPerPage,
includeHiddenPhotos,
includeHiddenPhotos ? 'include' : 'exclude',
)
, [useCachedPhotos, initialOffset, itemsPerPage, includeHiddenPhotos]);

View File

@ -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 }))