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

@ -10,12 +10,10 @@ namespace DamageAssesment.Api.Responses.Services
{
}
public async Task<List<Question>> getQuestionsAsync(string language)
public async Task<List<Question>> getQuestionsAsync()
{
try
{
if (!string.IsNullOrEmpty(language))
url = url + "/" + language;
var responseJsonString = await httpUtil.SendAsync(HttpMethod.Get, url, null);
var questions = JsonConvert.DeserializeObject<List<Question>>(responseJsonString);
@ -29,28 +27,7 @@ namespace DamageAssesment.Api.Responses.Services
return new List<Question>();
}
}
public async Task<List<QuestionCategory>> GetQuestionCategoriesAsync(string? language)
{
try
{
url = urlBase + configuration.GetValue<string>("RessourceSettings:QuestionCategory");
if (!string.IsNullOrEmpty(language))
url = url + "/" + language;
var responseJsonString = await httpUtil.SendAsync(HttpMethod.Get, url, null);
var questions = JsonConvert.DeserializeObject<List<QuestionCategory>>(responseJsonString);
if (questions == null || !questions.Any())
return new List<QuestionCategory>();
else return questions;
}
catch (Exception ex)
{
logger?.LogError($"Exception Found : {ex.Message} - Ref: QuestionServiceProvider.GetQuestionCategoriesAsync()");
return new List<QuestionCategory>();
}
}
public async Task<List<SurveyQuestions>> getSurveyQuestionsAsync(int surveyId)
{
try
@ -60,7 +37,7 @@ namespace DamageAssesment.Api.Responses.Services
var questions = JsonConvert.DeserializeObject<List<SurveyQuestions>>(responseJsonString);
if (questions == null || !questions.Any())
return new List<SurveyQuestions>();
return new List<SurveyQuestions>() ;
else return questions;
}
catch (Exception ex)