can create Surveys for fun now
This commit is contained in:
parent
77a49ff49b
commit
2b5f468b84
2 changed files with 14 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using SurveyBackend.DTOs.Survey;
|
||||
using SurveyLib.Core.Models;
|
||||
using SurveyLib.Core.Services;
|
||||
using SurveyLib.Infrastructure.EFCore.Services;
|
||||
|
|
@ -31,8 +32,13 @@ public class SurveyController : ControllerBase
|
|||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> Post([FromBody] Survey survey)
|
||||
public async Task<IActionResult> Post([FromBody] CreateSurveyDTO dto)
|
||||
{
|
||||
var survey = new Survey
|
||||
{
|
||||
Title = dto.Title,
|
||||
Description = dto.Description,
|
||||
};
|
||||
await _surveyService.AddSurveyAsync(survey);
|
||||
return Ok();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue