vendure-entity.data-mapper.ts 432 B

1234567891011121314
  1. import { VendureEntity } from '@vendure/core';
  2. import { EntitySearchIndexItem } from '../types';
  3. import { EntityDataMapper } from './entity-data-mapper.interface';
  4. export class VendureEntityDataMapper implements EntityDataMapper {
  5. map(entity: VendureEntity): Partial<EntitySearchIndexItem> {
  6. return {
  7. entityId: entity.id,
  8. lastModified: entity.updatedAt ?? entity.createdAt,
  9. };
  10. }
  11. }