From 59347cd0b60c7af9b2182987611df55d3f128e0b Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sat, 21 May 2022 18:24:46 +0200 Subject: [PATCH] Replace full url. --- cli/Squidex.CLI/Directory.Build.props | 2 +- .../Sync/Contents/Extensions.cs | 30 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cli/Squidex.CLI/Directory.Build.props b/cli/Squidex.CLI/Directory.Build.props index b78fe0c4..d7965d40 100644 --- a/cli/Squidex.CLI/Directory.Build.props +++ b/cli/Squidex.CLI/Directory.Build.props @@ -8,6 +8,6 @@ MIT https://github.com/Squidex/squidex/ Squidex HeadlessCMS - 8.15 + 8.16 diff --git a/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/Contents/Extensions.cs b/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/Contents/Extensions.cs index 45b27461..f9b76a6f 100644 --- a/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/Contents/Extensions.cs +++ b/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/Contents/Extensions.cs @@ -53,20 +53,20 @@ public static void MapComponents(this ContentModel model, Dictionary? languages; - private string? sourceUrl; private string? sourceApp; - private string? sourcePathToAssets; - private string? sourcePathToContent; + private string? sourceUrl; + private string? sourceUrlToAssets; + private string? sourceUrlToContent; public Mapper(string url, string app, string[]? languages) { this.url = url.TrimEnd('/'); - pathToAssets = $"api/assets/{app}/"; - pathToContent = $"api/content/{app}/"; + urlToAssets = $"{this.url}/api/assets/{app}/"; + urlToContent = $"{this.url}/api/content/{app}/"; this.languages = languages?.ToHashSet(); } @@ -86,8 +86,8 @@ public void Map(ContentsModel model) if (sourceApp != null) { - sourcePathToAssets = $"api/assets/{sourceApp}/"; - sourcePathToContent = $"api/content/{sourceApp}/"; + sourceUrlToAssets = $"{sourceUrl}/api/assets/{sourceApp}/"; + sourceUrlToContent = $"{sourceUrl}/api/content/{sourceApp}/"; } } @@ -113,19 +113,19 @@ private void MapStrings(ContentModel content) return value; } - if (sourceUrl != null) + if (sourceUrlToAssets != null) { - value = value?.Replace(sourceUrl, url, StringComparison.OrdinalIgnoreCase); + value = value?.Replace(sourceUrlToAssets, urlToAssets, StringComparison.OrdinalIgnoreCase); } - if (sourcePathToAssets != null) + if (sourceUrlToContent != null) { - value = value?.Replace(sourcePathToAssets, pathToAssets, StringComparison.OrdinalIgnoreCase); + value = value?.Replace(sourceUrlToContent, urlToContent, StringComparison.OrdinalIgnoreCase); } - if (sourcePathToContent != null) + if (sourceUrl != null) { - value = value?.Replace(sourcePathToContent, pathToContent, StringComparison.OrdinalIgnoreCase); + value = value?.Replace(sourceUrl, url, StringComparison.OrdinalIgnoreCase); } return value;