public async Task <IActionResult> Insert([FromBody] AgencyInfoMeta agencyInfoMeta) { var result = await _agencyInfoService.Insert(CurrentUser.TenantId, CurrentUser.Id, CurrentUser.FullName, CurrentUser.Avatar, agencyInfoMeta); if (result.Code <= 0) { return(BadRequest(result)); } return(Ok(result)); }
public async Task <JsonResult> AgencyRegister(AgencyMeta agencyMeta) { if (!ModelState.IsValid) { return(Json(GetErrorsInModelState())); } var apiService = _configuration.GetApiServiceInfo(); var agencyMetaData = JsonConvertHelper.GetObjectFromObject <GHM.WebsiteClient.Api.Domain.ModelMetas.AgencyInfoMeta>(agencyMeta); agencyMetaData.TenantId = apiService.TenantId; var result = await _agencyInfoService.Insert(CultureInfo.CurrentCulture.Name, agencyMetaData); return(Json(result)); }