18 lines
583 B
JavaScript
18 lines
583 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.GetFindingQuery = void 0;
|
|
const Result_1 = require("../../../../shared/domain/Result");
|
|
class GetFindingQuery {
|
|
constructor(repository) {
|
|
this.repository = repository;
|
|
}
|
|
async execute(request) {
|
|
const finding = await this.repository.findById(request.findingId);
|
|
if (!finding) {
|
|
return (0, Result_1.Err)(`Finding not found: ${request.findingId}`);
|
|
}
|
|
return (0, Result_1.Ok)(finding);
|
|
}
|
|
}
|
|
exports.GetFindingQuery = GetFindingQuery;
|