From a1864dea070878ee32f71958b97050e71307b189 Mon Sep 17 00:00:00 2001 From: EngincanV Date: Tue, 13 Apr 2021 17:29:49 +0300 Subject: [PATCH] Update DocumentAppService.cs --- .../Volo/Docs/Documents/DocumentAppService.cs | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs index 73cc7e7a06..4d451a1d4f 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs @@ -201,21 +201,24 @@ namespace Volo.Docs.Documents foreach (var project in projects) { - if (project.ShortName == "ABP Commercial" || project.Name == "ABP Commercial") - { - continue; - } - var documents = await _documentRepository.GetListByProjectId(project.Id); foreach (var document in documents) { - var navigationNode = await GetNavigationAsync(new GetNavigationDocumentInput + var version = GetProjectVersionPrefixIfExist(project) + document.Version; + var navigationDocument = await GetDocumentWithDetailsDtoAsync( + project, + project.NavigationDocumentName, + document.LanguageCode, + version + ); + + if (!DocsJsonSerializerHelper.TryDeserialize(navigationDocument.Content, + out var navigationNode)) { - ProjectId = project.Id, - LanguageCode = document.LanguageCode, - Version = document.Version - }); + throw new UserFriendlyException( + $"Cannot validate navigation file '{project.NavigationDocumentName}' for the project {project.Name}."); + } navigationNode.Items?.ForEach(node => {