Files
SerpentRace/SerpentRace_Backend/dist/Application/Contact/queries/GetContactByIdQueryHandler.js
T

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