From 7b177f21c87cab22a538c53d81529bb2034186e2 Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 16 Jan 2026 10:08:47 +0100 Subject: [PATCH] Remove ResultViewController and related API endpoints Removed the entire ResultViewController.cs file, including all endpoints for result view queries and insertions. This eliminates support for fake profile IDs, result type filtering, and all related API logic from the codebase. --- .../Controllers/ResultViewController.cs | 49 ------------------- 1 file changed, 49 deletions(-) delete mode 100644 src/ReC.API/Controllers/ResultViewController.cs diff --git a/src/ReC.API/Controllers/ResultViewController.cs b/src/ReC.API/Controllers/ResultViewController.cs deleted file mode 100644 index 8fe0b41..0000000 --- a/src/ReC.API/Controllers/ResultViewController.cs +++ /dev/null @@ -1,49 +0,0 @@ -using MediatR; -using Microsoft.AspNetCore.Mvc; -using ReC.API.Extensions; -using ReC.API.Models; -using ReC.Application.OutResults.Commands; -using ReC.Application.OutResults.Queries; - -namespace ReC.API.Controllers; - -[Route("api/[controller]")] -[ApiController] -public class ResultViewController(IMediator mediator, IConfiguration config) : ControllerBase -{ - [HttpGet] - [ProducesResponseType(StatusCodes.Status200OK)] - public async Task Get([FromQuery] ReadResultViewQuery query, CancellationToken cancel) => Ok(await mediator.Send(query, cancel)); - - [HttpGet("fake")] - [ProducesResponseType(StatusCodes.Status200OK)] - public async Task Get(CancellationToken cancel) => Ok(await mediator.Send(new ReadResultViewQuery() - { - ProfileId = config.GetFakeProfileId() - }, cancel)); - - [HttpGet("fake/{actionId}")] - [ProducesResponseType(StatusCodes.Status200OK)] - public async Task Get([FromRoute] long actionId, CancellationToken cancel, ResultType resultType = ResultType.Full) - { - var res = (await mediator.Send(new ReadResultViewQuery() - { - ProfileId = config.GetFakeProfileId(), - ActionId = actionId - }, cancel)).First(); - - return resultType switch - { - ResultType.OnlyBody => res.Body is null ? NotFound() : Ok(res.Body.JsonToDynamic()), - ResultType.OnlyHeader => res.Header is null ? NotFound() : Ok(res.Header.JsonToDynamic()), - _ => Ok(res), - }; - } - - [HttpPost] - public async Task Create([FromBody] InsertResultProcedure procedure, CancellationToken cancel) - { - await mediator.Send(procedure, cancel); - return CreatedAtAction(nameof(Get), new { actionId = procedure.ActionId }, procedure); - } -} \ No newline at end of file