Skip to content

Commit

Permalink
add mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
bahram1249 committed Feb 8, 2025
1 parent 6245708 commit 9ce9a45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/eav/src/admin/post/mapper/post.mapper.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Injectable } from '@nestjs/common';
import { AutomapperProfile, InjectMapper } from 'automapper-nestjs';
import { PostDto } from '../dto';
import { PhotoDto, PostDto } from '../dto';
import { Mapper, createMap, forMember, ignore } from 'automapper-core';
import { EAVPost } from '@rahino/database';
import { PostAttachmentDto } from '../dto/post-attachment.dto';

@Injectable()
export class PostProfile extends AutomapperProfile {
Expand All @@ -18,6 +19,8 @@ export class PostProfile extends AutomapperProfile {
EAVPost,
forMember((dest) => dest.id, ignore()),
);

createMap(mapper, PostAttachmentDto, PhotoDto);
};
}
}

0 comments on commit 9ce9a45

Please sign in to comment.