BMC: Validation Message For Company Id in Login API

This commit is contained in:
Palash Biswas 2023-01-12 09:41:47 +05:30
parent 6180e3356a
commit 9ecc2c1825

View File

@ -282,7 +282,7 @@ namespace BCS.BMC.Controllers
var protocol = ""; var protocol = "";
if (string.IsNullOrWhiteSpace(input.CompanyUrl)) if (string.IsNullOrWhiteSpace(input.CompanyUrl))
{ {
return BadRequest("Please Enter A Valid Url"); return BadRequest("Please enter a valid Url");
} }
using (HttpClient client = new HttpClient()) using (HttpClient client = new HttpClient())
{ {
@ -305,6 +305,11 @@ namespace BCS.BMC.Controllers
{ {
return BadRequest("Invalid Company Url"); return BadRequest("Invalid Company Url");
} }
var companyAccountId = await _companyMaster.FirstOrDefaultAsync(x => x.CompanyName == input.CompanyId);
if (companyAccountId == null)
{
return BadRequest("Please enter valid Company Account ID");
}
// var baseUrl = uri + "api/BmcLogin"; // var baseUrl = uri + "api/BmcLogin";
var baseUrl = protocol + "://" + host + "/api/BmcLogin"; var baseUrl = protocol + "://" + host + "/api/BmcLogin";