Adding endpoint for mutiple questions update

This commit is contained in:
Reginald Cherenfant Jasmin
2023-12-07 02:16:00 -05:00
parent 3de53c1198
commit d7005479c5
7 changed files with 43 additions and 12 deletions

View File

@ -376,6 +376,22 @@ namespace DamageAssesment.Api.Questions.Providers
return (false, null, ex.Message);
}
}
public async Task<(bool IsSuccess, IEnumerable<Models.MultiLanguage> Question, string ErrorMessage)> PutQuestionsAsync(int surveyId, List<Models.Question> Questions)
{
try
{
questionDbContext.Questions.ToList().RemoveAll(s=> s.SurveyId == surveyId);
questionDbContext.SaveChanges();
var response = await PostQuestionsAsync(Questions);
return (response);
}
catch (Exception ex)
{
logger?.LogError(ex.ToString());
return (false, null, ex.Message);
}
}
public async Task<(bool IsSuccess, Models.MultiLanguage Question, string ErrorMessage)> UpdateQuestionAsync(Models.Question Question)
{
try