diff --git a/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs b/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs index 8b9fd602..cbce5e53 100644 --- a/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs +++ b/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs @@ -1,6 +1,7 @@ using System.Transactions; using _0_Framework.Application; using _0_Framework.Application.Enums; +using _0_Framework.Exceptions; using AccountManagement.Application.Contracts.Account; using CompanyManagement.Infrastructure.Excel.InstitutionContract; using CompanyManagment.App.Contracts.Employer; @@ -655,6 +656,10 @@ public class institutionContractController : AdminBaseController public async Task> Create([FromBody]CreateInstitutionContractRequest command) { var res =await _institutionContractApplication.CreateAsync(command); + + if(!res.IsSuccedded) + throw new BadRequestException(res.Message); + return res; }