Skip to content

Commit

Permalink
Refactor DocumentPresentationFactory to use ITemplateService instead …
Browse files Browse the repository at this point in the history
…of IFileService (#15995)
  • Loading branch information
nikolajlauridsen committed Apr 9, 2024
1 parent 9c18cd2 commit 91085d9
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -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;
}
Expand All @@ -44,7 +44,7 @@ public async Task<DocumentResponseModel> CreateResponseModelAsync(IContent conte
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
Expand Down

0 comments on commit 91085d9

Please sign in to comment.