From 9555497d4e288b97206b8883f43e588703370dc5 Mon Sep 17 00:00:00 2001 From: shept Date: Tue, 13 May 2025 19:16:20 +0500 Subject: [PATCH] controllers to naming --- .../Controllers/QuestionController.cs | 4 ++-- .../SurveyBackend.API/Controllers/SurveyController.cs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SurveyBackend/SurveyBackend.API/Controllers/QuestionController.cs b/SurveyBackend/SurveyBackend.API/Controllers/QuestionController.cs index 24367f6..fb72465 100644 --- a/SurveyBackend/SurveyBackend.API/Controllers/QuestionController.cs +++ b/SurveyBackend/SurveyBackend.API/Controllers/QuestionController.cs @@ -29,7 +29,7 @@ public class QuestionController : ControllerBase [AllowAnonymous] [HttpGet] [ProducesResponseType(StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] public async Task GetBySurveyId([FromRoute] int surveyId) { var questions = await _questionService.GetQuestionsBySurveyIdAsync(surveyId); @@ -48,7 +48,7 @@ public class QuestionController : ControllerBase [HttpPost] [ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status200OK)] - public async Task AddQuestion(CreateQuestionDto dto, [FromRoute] int surveyId) + public async Task AddQuestion(QuestionCreateDto dto, [FromRoute] int surveyId) { var model = QuestionMapper.QuestionCreationToModel(dto, surveyId); await _questionService.AddQuestionAsync(model); diff --git a/SurveyBackend/SurveyBackend.API/Controllers/SurveyController.cs b/SurveyBackend/SurveyBackend.API/Controllers/SurveyController.cs index 6e61320..ca82219 100644 --- a/SurveyBackend/SurveyBackend.API/Controllers/SurveyController.cs +++ b/SurveyBackend/SurveyBackend.API/Controllers/SurveyController.cs @@ -32,7 +32,7 @@ public class SurveyController : ControllerBase /// [AllowAnonymous] [HttpGet] - [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] public async Task Get() { var surveys = await _surveyService.GetSurveysAsync(); @@ -49,7 +49,7 @@ public class SurveyController : ControllerBase [AllowAnonymous] [HttpGet("{id}")] [ProducesResponseType(StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(OutputSurveyDto), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(SurveyOutputDto), StatusCodes.Status200OK)] public async Task Get(int id) { var survey = await _surveyService.GetSurveyAsync(id); @@ -66,7 +66,7 @@ public class SurveyController : ControllerBase [Authorize] [HttpPost] [ProducesResponseType(StatusCodes.Status200OK)] - public async Task Post([FromBody] CreateSurveyDto dto) + public async Task Post([FromBody] SurveyCreateDto dto) { var userId = _userContext.UserId; @@ -84,7 +84,7 @@ public class SurveyController : ControllerBase /// [Authorize] [HttpPut("{id}")] - public async Task Put(int id, [FromBody] UpdateSurveyDto dto) + public async Task Put(int id, [FromBody] SurveyUpdateDto dto) { var userId = _userContext.UserId; var survey = SurveyMapper.UpdateDtoToModel(dto, userId, id); @@ -118,7 +118,7 @@ public class SurveyController : ControllerBase [Authorize] [HttpGet("my")] [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] public async Task GetMySurveys() { var userId = _userContext.UserId;