matcher/old/modules/ad/mappers/ad.profile.ts

19 lines
535 B
TypeScript
Raw Normal View History

2023-05-12 14:23:42 +00:00
import { createMap, Mapper } from '@automapper/core';
import { AutomapperProfile, InjectMapper } from '@automapper/nestjs';
import { Injectable } from '@nestjs/common';
import { Ad } from '../domain/entities/ad';
2023-04-26 10:10:22 +00:00
import { CreateAdRequest } from '../domain/dtos/create-ad.request';
@Injectable()
export class AdProfile extends AutomapperProfile {
constructor(@InjectMapper() mapper: Mapper) {
super(mapper);
}
override get profile() {
return (mapper: any) => {
2023-05-12 14:23:42 +00:00
createMap(mapper, CreateAdRequest, Ad);
};
}
}