Skip to content

Commit

Permalink
(Oops, incomplete commit)
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkidu93 committed Oct 5, 2023
1 parent 68d3fae commit 5337e8a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -984,13 +984,12 @@ private static Build Map(Engine engine, TranslationBuildConfigDto source)
}
try
{
JsonSerializer.Deserialize<JsonObject>(source.Options ?? "{}");
build.Options = JsonConvert.DeserializeObject<IDictionary<string, object>>(source.Options ?? "{}");
}
catch (Exception e)
{
throw new ArgumentException($"Unable to parse field 'options' : {e.Message}");
}
build.Options = source.Options;
return build;
}

Expand Down Expand Up @@ -1030,7 +1029,7 @@ private TranslationBuildDto Map(Build source)
Message = source.Message,
State = source.State,
DateFinished = source.DateFinished,
Options = source.Options
Options = JsonConvert.SerializeObject(source.Options)
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/Serval.Translation/Models/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ public class Build : IEntity
public string? Message { get; set; }
public JobState State { get; set; } = JobState.Pending;
public DateTime? DateFinished { get; set; }
public string? Options { get; set; }
public IDictionary<string, object>? Options { get; set; }
}
1 change: 1 addition & 0 deletions src/Serval.Translation/Usings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
global using Microsoft.AspNetCore.Routing;
global using Microsoft.Extensions.Configuration;
global using Microsoft.Extensions.Options;
global using Newtonsoft.Json;
global using NSwag.Annotations;
global using Serval.Shared.Configuration;
global using Serval.Shared.Contracts;
Expand Down

0 comments on commit 5337e8a

Please sign in to comment.