forked from MDCPS/DamageAssessment_Backend
Add EmployeeId as filter in the endpoints, add endpoints to get all active and historical surveys for a particular employee
This commit is contained in:
@ -4,16 +4,18 @@ using Newtonsoft.Json;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
||||
{
|
||||
public class SurveyServiceProvider :ServiceProviderBase, ISurveyServiceProvider
|
||||
public class SurveyServiceProvider : ServiceProviderBase, ISurveyServiceProvider
|
||||
{
|
||||
public SurveyServiceProvider(IConfiguration configuration, IHttpUtil httpUtil, ILogger<EmployeeServiceProvider> logger) : base(configuration, httpUtil, logger, configuration.GetValue<string>("RessourceSettings:Survey"), configuration.GetValue<string>("EndPointSettings:SurveyUrlBase"))
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<List<Survey>> getSurveysAsync()
|
||||
public async Task<List<Survey>> getSurveysAsync(string language)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(language))
|
||||
url = url + "/" + language;
|
||||
var responseJsonString = await httpUtil.SendAsync(HttpMethod.Get, url, null);
|
||||
var surveys = JsonConvert.DeserializeObject<List<Survey>>(responseJsonString);
|
||||
|
||||
@ -36,7 +38,7 @@ namespace DamageAssesment.Api.SurveyResponses.Services
|
||||
var responseJsonString = await httpUtil.SendAsync(HttpMethod.Get, url, null);
|
||||
var survey = JsonConvert.DeserializeObject<Survey>(responseJsonString);
|
||||
|
||||
if (survey == null )
|
||||
if (survey == null)
|
||||
return null;
|
||||
else return survey;
|
||||
}
|
||||
|
Reference in New Issue
Block a user