Refactor ResultType enum location and naming for clarity

Move ResultType enum to ReC.API.Models/ResultType.cs and update its values from Header/Body to OnlyHeader/OnlyBody for improved clarity. Update all controller usages and documentation to reflect these changes.
This commit is contained in:
2025-12-17 09:35:24 +01:00
parent a92d57d9cf
commit 9b3bb925f9
3 changed files with 25 additions and 25 deletions

View File

@@ -1,6 +1,7 @@
using MediatR;
using Microsoft.AspNetCore.Mvc;
using ReC.API.Extensions;
using ReC.API.Models;
using ReC.Application.ResultViews.Queries;
namespace ReC.API.Controllers;
@@ -32,8 +33,8 @@ public class ResultViewController(IMediator mediator, IConfiguration config) : C
return resultType switch
{
ResultType.Body => res.Body is null ? NotFound() : Ok(res.Body.JsonToDynamic()),
ResultType.Header => res.Header is null ? NotFound() : Ok(res.Header.JsonToDynamic()),
ResultType.OnlyBody => res.Body is null ? NotFound() : Ok(res.Body.JsonToDynamic()),
ResultType.OnlyHeader => res.Header is null ? NotFound() : Ok(res.Header.JsonToDynamic()),
_ => Ok(res),
};
}