Update result status handling in InsertResultCommand
Replaced StatusId with Status property in InsertResultCommand, mapping HTTP status codes to application-specific status enums using ToStatus(). Exception handling now sets Status to QueryFailed. Removed usage of StatusId.
This commit is contained in:
@@ -146,7 +146,7 @@ public class InvokeRecActionViewCommandHandler(
|
||||
|
||||
await sender.Send(new InsertResultCommand()
|
||||
{
|
||||
StatusId = statusCode,
|
||||
Status = response.StatusCode.ToStatus(),
|
||||
ActionId = action.Id,
|
||||
Header = JsonSerializer.Serialize(resHeaders, options: new() { WriteIndented = false }),
|
||||
Body = resBody,
|
||||
@@ -157,6 +157,7 @@ public class InvokeRecActionViewCommandHandler(
|
||||
{
|
||||
await sender.Send(new InsertResultCommand()
|
||||
{
|
||||
Status = Status.QueryFailed,
|
||||
ActionId = action.Id,
|
||||
Error = ex.ToString(),
|
||||
Type = ResultType.Main
|
||||
|
||||
Reference in New Issue
Block a user