a18203934c
Changes: - as we store date in redis as serialized, let's make all flatEntity dates as string. This requires changing FlatEntity types and making sure that entity are converted to flatEntity and flatEntity to dtos
18 lines
604 B
TypeScript
18 lines
604 B
TypeScript
import { type SyncableFlatEntity } from 'src/engine/metadata-modules/flat-entity/types/flat-entity.type';
|
|
import {
|
|
findFlatEntityByIdInFlatEntityMapsOrThrow,
|
|
type FindFlatEntityByIdInFlatEntityMapsOrThrowArgs,
|
|
} from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-id-in-flat-entity-maps-or-throw.util';
|
|
|
|
export const findFlatEntityByIdInFlatEntityMaps = <
|
|
T extends SyncableFlatEntity,
|
|
>(
|
|
args: FindFlatEntityByIdInFlatEntityMapsOrThrowArgs<T>,
|
|
): T | undefined => {
|
|
try {
|
|
return findFlatEntityByIdInFlatEntityMapsOrThrow(args);
|
|
} catch {
|
|
return undefined;
|
|
}
|
|
};
|