Update SurveyLib and start refactoring endpoint paths

This commit is contained in:
Вячеслав 2025-05-31 01:03:12 +05:00
parent c2f6ba6dde
commit 637e6c9824
5 changed files with 22 additions and 15 deletions

View file

@ -61,7 +61,7 @@ public static class QuestionMapper
};
}
public static QuestionBase QuestionUpdateToModel(QuestionCreateDto dto, int surveyId, int questionId)
public static QuestionBase QuestionUpdateToModel(QuestionCreateDto dto, int questionId)
{
return dto.QuestionType.ToLower() switch
{
@ -69,20 +69,20 @@ public static class QuestionMapper
{
Id = questionId,
Title = dto.Title,
SurveyId = surveyId,
SurveyId = 0, // bad logic, need to do something
},
"singleanswerquestion" => new SingleAnswerQuestion
{
Id = questionId,
Title = dto.Title,
SurveyId = surveyId,
SurveyId = 0,
AnswerVariants = [],
},
"multipleanswerquestion" => new MultipleAnswerQuestion
{
Id = questionId,
Title = dto.Title,
SurveyId = surveyId,
SurveyId = 0,
AnswerVariants = []
},
_ => throw new BadRequestException("Unknown question type")