18 lines
650 B
JavaScript
18 lines
650 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.GetContactByIdQueryHandler = void 0;
|
|
const ContactMapper_1 = require("../../DTOs/Mappers/ContactMapper");
|
|
class GetContactByIdQueryHandler {
|
|
constructor(contactRepo) {
|
|
this.contactRepo = contactRepo;
|
|
}
|
|
async execute(query) {
|
|
const contact = await this.contactRepo.findById(query.id);
|
|
if (!contact) {
|
|
return null;
|
|
}
|
|
return ContactMapper_1.ContactMapper.toDetailDto(contact);
|
|
}
|
|
}
|
|
exports.GetContactByIdQueryHandler = GetContactByIdQueryHandler;
|
|
//# sourceMappingURL=GetContactByIdQueryHandler.js.map
|