Skip to content

Commit

Permalink
feat: handle varies by language for non string values
Browse files Browse the repository at this point in the history
  • Loading branch information
mzanoni committed Jul 31, 2024
1 parent b111943 commit 19255fa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Integrations.Umbraco/Services/RelewisePropertyConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,17 @@ internal class RelewisePropertyConverter(IEnumerable<IRelewisePropertyValueConve
}
else
{
dataKeys.Add(values.Key, new Multilingual(values.Select(x => new Multilingual.Value(x.Lang, x.Value)).ToArray()));
if (values.First().Value?.Type == DataValue.DataValueTypes.String)
{
dataKeys.Add(values.Key, new Multilingual(values.Select(x => new Multilingual.Value(x.Lang, x.Value)).ToArray()));
}
else
{
foreach ((string Lang, string Key, DataValue? Value) dataValue in values)
{
dataKeys.Add($"{dataValue.Key}_{dataValue.Lang}", dataValue.Value);
}
}
}
}
else
Expand Down

0 comments on commit 19255fa

Please sign in to comment.