Revert "Merged PR 53: fixed survey put issue, and added export excel in responses

fixed survey put issue, amd added export excel in responses"
This commit is contained in:
Santhosh Nair
2023-11-01 15:35:20 +00:00
parent 6fbe21979f
commit 0c13528940
16 changed files with 47 additions and 363 deletions

View File

@ -217,10 +217,12 @@ namespace DamageAssesment.Api.Surveys.Providers
_survey = mapper.Map<Models.Survey, Db.Survey>(survey);
surveyDbContext.Surveys.Update(_survey);
await surveyDbContext.SaveChangesAsync();
List<Db.SurveyTranslation> listSurveyTranslation = new List<Db.SurveyTranslation>();
Random random = new Random();
foreach (var title in survey.Titles)
{
listSurveyTranslation.Add(new Db.SurveyTranslation { SurveyId = _survey.Id, Language = title.Language, Title = title.Title });
listSurveyTranslation.Add(new Db.SurveyTranslation { Id = random.Next(), SurveyId = _survey.Id, Language = title.Language, Title = title.Title });
}
surveyDbContext.SurveysTranslation.AddRange(listSurveyTranslation);
await surveyDbContext.SaveChangesAsync();