forked from MDCPS/DamageAssessment_Backend
Adding endpoint for mutiple questions update
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user