Refactor DocumentPresentationFactory to use ITemplateService instead of IFileService (#15995)

This commit is contained in:
Mole
2024-04-09 10:18:26 +02:00
committed by GitHub
parent 9c18cd22e0
commit 91085d9b21

View File

@@ -19,20 +19,20 @@ internal sealed class DocumentPresentationFactory : IDocumentPresentationFactory
{
private readonly IUmbracoMapper _umbracoMapper;
private readonly IDocumentUrlFactory _documentUrlFactory;
private readonly IFileService _fileService;
private readonly ITemplateService _templateService;
private readonly IPublicAccessService _publicAccessService;
private readonly TimeProvider _timeProvider;
public DocumentPresentationFactory(
IUmbracoMapper umbracoMapper,
IDocumentUrlFactory documentUrlFactory,
IFileService fileService,
ITemplateService templateService,
IPublicAccessService publicAccessService,
TimeProvider timeProvider)
{
_umbracoMapper = umbracoMapper;
_documentUrlFactory = documentUrlFactory;
_fileService = fileService;
_templateService = templateService;
_publicAccessService = publicAccessService;
_timeProvider = timeProvider;
}
@@ -44,7 +44,7 @@ internal sealed class DocumentPresentationFactory : IDocumentPresentationFactory
responseModel.Urls = await _documentUrlFactory.GetUrlsAsync(content);
Guid? templateKey = content.TemplateId.HasValue
? _fileService.GetTemplate(content.TemplateId.Value)?.Key
? _templateService.GetAsync(content.TemplateId.Value).Result?.Key
: null;
responseModel.Template = templateKey.HasValue