diff --git a/Marco.Pms.Services/Controllers/TenantController.cs b/Marco.Pms.Services/Controllers/TenantController.cs index e09fe35..3dd30d3 100644 --- a/Marco.Pms.Services/Controllers/TenantController.cs +++ b/Marco.Pms.Services/Controllers/TenantController.cs @@ -933,7 +933,6 @@ namespace Marco.Pms.Services.Controllers } var industry = await context.Industries.FirstOrDefaultAsync(i => i.Id == model.IndustryId); - if (industry == null) { _logger.LogWarning("Industry not found while creating the tenant enquire"); diff --git a/Marco.Pms.Services/Service/TenantService.cs b/Marco.Pms.Services/Service/TenantService.cs index 03beea9..f5aa6ef 100644 --- a/Marco.Pms.Services/Service/TenantService.cs +++ b/Marco.Pms.Services/Service/TenantService.cs @@ -310,11 +310,11 @@ namespace Marco.Pms.Services.Service var tenantVM = _mapper.Map(tenant); tenantVM.CreatedBy = _mapper.Map(employeeUser); - await AddSubscriptionAsync(tenantId, employeeId, paymentDetailId, planId); - // Commit the transaction as all operations were successful. await transaction.CommitAsync(); + await AddSubscriptionAsync(tenantId, employeeId, paymentDetailId, planId); + _logger.LogInfo("Successfully created tenant {TenantId} for organization {OrganizationName}.", tenant.Id, tenant.Name); return ApiResponse.SuccessResponse(tenantVM, "Tenant created successfully.", 201); }