This commit is contained in:
Frede Hundewadt 2023-01-10 13:51:14 +01:00
parent e1b9004629
commit 4f8f24132c

View file

@ -108,7 +108,7 @@ public class CountryCustomerRepository : ICountryCustomerRepository
["hasFolded"] = paging.HasFolded.ToString(),
};
var response = await _client.GetAsync(QueryHelpers.AddQueryString($"{_api.OfficeCustomers}/salesRep/{salesRepId}/", queryString));
var response = await _client.GetAsync(QueryHelpers.AddQueryString($"{_api.OfficeCustomers}/{countryCode}/salesRep/{salesRepId}/", queryString));
var content = await response.Content.ReadAsStringAsync();
var pagingResponse = new PagingResponse<CompanyDto>
{
@ -127,7 +127,7 @@ public class CountryCustomerRepository : ICountryCustomerRepository
/// <returns></returns>
public async Task<CompanyDto> GetByCustomerId(string countryCode, string companyId)
{
var company = await _client.GetFromJsonAsync<CompanyDto>($"{_api.OfficeCustomers}/id/{companyId}");
var company = await _client.GetFromJsonAsync<CompanyDto>($"{_api.OfficeCustomers}/{countryCode}/id/{companyId}");
return company ?? new CompanyDto();
}
@ -140,7 +140,7 @@ public class CountryCustomerRepository : ICountryCustomerRepository
/// <returns></returns>
public async Task<bool> UpdateCompany(string countryCode, string companyId, CompanyDto model)
{
var response = await _client.PutAsJsonAsync($"{_api.OfficeCustomers}/{companyId}", model);
var response = await _client.PutAsJsonAsync($"{_api.OfficeCustomers}/{countryCode}/{companyId}", model);
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
return response.IsSuccessStatusCode;