public async Task <IActionResult> Index() { var model = new TemplateIndexModel(); model.CallQuickTemplates = await _templatesService.GetAllCallQuickTemplatesForDepartmentAsync(DepartmentId); return(View(model)); }
public async Task <ActionResult <List <CallTemplateResult> > > GetCallTemplates() { List <CallTemplateResult> templatesJson = new List <CallTemplateResult>(); var templates = await _templatesService.GetAllCallQuickTemplatesForDepartmentAsync(DepartmentId); foreach (var template in templates) { CallTemplateResult templateJson = new CallTemplateResult(); templateJson.Id = template.CallQuickTemplateId; templateJson.IsDisabled = template.IsDisabled; templateJson.Name = template.Name; templateJson.CallName = template.CallName; templateJson.CallNature = template.CallNature; templateJson.CallType = template.CallType; templateJson.CallPriority = template.CallPriority; templateJson.CreatedByUserId = template.CreatedByUserId; templateJson.CreatedOn = template.CreatedOn; templatesJson.Add(templateJson); } return(Ok(templatesJson)); }