update
This commit is contained in:
@@ -84,7 +84,7 @@
|
||||
new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = true,
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
});
|
||||
}
|
||||
private async Task OpenImportDialog()
|
||||
@@ -220,7 +220,12 @@
|
||||
|
||||
try
|
||||
{
|
||||
var orderMsg = JsonSerializer.Deserialize<OrderMsg>(OrderJson);
|
||||
var orderMsg = JsonSerializer.Deserialize<OrderMsg>(OrderJson,
|
||||
new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = true,
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
});
|
||||
if (orderMsg is null)
|
||||
{
|
||||
Snackbar.Add("Unable to convert JSON to Order", Severity.Warning);
|
||||
@@ -251,20 +256,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
var response = await Http.PostAsJsonAsync(
|
||||
"/api/order",
|
||||
JsonSerializer.Deserialize<OrderMsg>(OrderJson)
|
||||
);
|
||||
var response = await Http.PostAsJsonAsync("/api/order",orderMsg);
|
||||
|
||||
sendSuccess = response.IsSuccessStatusCode;
|
||||
|
||||
}
|
||||
catch(JsonException jsonEx)
|
||||
{
|
||||
Snackbar.Add($"Json to Order failed: {jsonEx.Message}", Severity.Warning);
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Snackbar.Add($"Send Order failed: {ex.Message}", Severity.Warning);
|
||||
sendSuccess = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user