Vercel/src/lens/data.ts
2025-03-17 10:01:00 -05:00

23 lines
512 B
TypeScript

import { formatLensParams, lensFromPhoto } from '.';
import {
getPhotosCached,
getPhotosMetaCached,
} from '@/photo/cache';
export const getPhotosLensDataCached = async (
make: string | undefined,
model: string,
limit: number,
) => {
const lens = formatLensParams({ make, model });
return Promise.all([
getPhotosCached({ lens, limit }),
getPhotosMetaCached({ lens }),
])
.then(([photos, meta]) => [
photos,
meta,
lensFromPhoto(photos[0], lens),
] as const);
};