19 lines
535 B
TypeScript
19 lines
535 B
TypeScript
import { createMap, Mapper } from '@automapper/core';
|
|
import { AutomapperProfile, InjectMapper } from '@automapper/nestjs';
|
|
import { Injectable } from '@nestjs/common';
|
|
import { Ad } from '../domain/entities/ad';
|
|
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) => {
|
|
createMap(mapper, CreateAdRequest, Ad);
|
|
};
|
|
}
|
|
}
|