Files
Hy2026/backend/Controllers/GrantCallsController.cs
T
Rafał Tyński 127ca92f63 feat(ideas): add idea creator, grant calls and applications
Implement the idea creator and application generator: idea status workflow, social canvas card, grant call windows with 409 when closed, and an LLM-backed idea assistant with offline fallback.
2026-10-04 03:13:45 +02:00

42 lines
1.1 KiB
C#

using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using TarninaHub.Application.Abstractions;
using TarninaHub.Application.Dtos;
namespace TarninaHub.Controllers;
[ApiController]
[ApiVersion("1.0")]
[Route("api/grant-calls")]
[Authorize]
public class GrantCallsController : ControllerBase
{
private readonly IGrantCallService _grantCalls;
public GrantCallsController(IGrantCallService grantCalls)
{
_grantCalls = grantCalls;
}
[HttpGet]
public async Task<ActionResult<IReadOnlyList<GrantCallResponse>>> List(
[FromQuery] string? status,
CancellationToken cancellationToken)
{
var calls = await _grantCalls.ListAsync(status, cancellationToken);
return Ok(calls);
}
[HttpGet("{grantCallId}")]
public async Task<ActionResult<GrantCallResponse>> GetById(
string grantCallId,
CancellationToken cancellationToken)
{
var call = await _grantCalls.GetAsync(grantCallId, cancellationToken);
return call is null ? NotFound() : Ok(call);
}
}