refactor: remove smart search entity (#17447)

refactor: smart search entity
This commit is contained in:
Jason Rasmussen 2025-04-08 09:56:45 -04:00 committed by GitHub
parent 2b131fe935
commit fdbe6d649f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 125 additions and 134 deletions

View file

@ -13,7 +13,10 @@ import { PartnerRepository } from 'src/repositories/partner.repository';
import { IBulkAsset, ImmichFile, UploadFile } from 'src/types';
import { checkAccess } from 'src/utils/access';
export const getAssetFile = (files: AssetFileEntity[], type: AssetFileType | GeneratedImageType) => {
export const getAssetFile = <T extends { type: AssetFileType }>(
files: T[],
type: AssetFileType | GeneratedImageType,
) => {
return (files || []).find((file) => file.type === type);
};