refactor #4198 - copy existing module

This commit is contained in:
sbwalker
2024-04-29 14:58:30 -04:00
parent a2fb728d3b
commit 2e7c3167f5
3 changed files with 22 additions and 42 deletions

View File

@ -7,6 +7,7 @@ using Oqtane.Repository;
using Oqtane.Shared;
using Oqtane.Migrations.Framework;
using Oqtane.Documentation;
using System.Linq;
// ReSharper disable ConvertToUsingDeclaration
@ -29,10 +30,11 @@ namespace Oqtane.Modules.HtmlText.Manager
public string ExportModule(Module module)
{
string content = "";
var htmlText = _htmlText.GetHtmlText(module.ModuleId);
if (htmlText != null)
var htmltexts = _htmlText.GetHtmlTexts(module.ModuleId);
if (htmltexts != null && htmltexts.Any())
{
content = WebUtility.HtmlEncode(htmlText.Content);
var htmltext = htmltexts.OrderByDescending(item => item.CreatedOn).First();
content = WebUtility.HtmlEncode(htmltext.Content);
}
return content;
}