Ignore:
Timestamp:
10/14/21 17:55:51 (3 years ago)
Author:
Стојков Марко <mst@…>
Branches:
dev
Children:
7f1a891
Parents:
7dd2ea2
Message:

Get question state endpoint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/FinkiChattery/FinkiChattery.Api/Controllers/v1/QuestionsController.cs

    r7dd2ea2 rb25b9ea  
    11using FinkiChattery.Api.ApplicationServices.Authentication;
     2using FinkiChattery.Api.ApplicationServices.Questioning;
    23using FinkiChattery.Commands.Questioning;
    34using FinkiChattery.Common.Mediator.Interfaces;
    45using FinkiChattery.Contracts.Questioning;
     6using FinkiChattery.Queries.Questioning;
    57using IdentityServer4.AccessTokenValidation;
    68using Microsoft.AspNetCore.Authorization;
    79using Microsoft.AspNetCore.Mvc;
     10using System;
    811using System.Threading.Tasks;
    912
     
    2932            return Ok();
    3033        }
     34
     35        [HttpGet("{questionUid:Guid}")]
     36        [Authorize]
     37        public async Task<IActionResult> GetQuestionState([FromRoute]Guid questionUid)
     38        {
     39            var questionDto = await MediatorService.SendQueryAsync(new GetQuestionStateQuery(questionUid));
     40            return Ok(questionDto.ToQuestionStateResponse());
     41        }
    3142    }
    3243}
Note: See TracChangeset for help on using the changeset viewer.