public async Task <IActionResult> SaveLayout([FromBody] SaveLayoutViewModel model) { var success = await _service.SaveLayoutAsync(model.TabId, model.LayoutList); if (!success) { return(StatusCode((int)HttpStatusCode.InternalServerError, $"Layout (tabid:{model.TabId}) NOT saved.")); } return(Ok()); }
public async Task <IActionResult> SaveLayout([FromBody] SaveLayoutViewModel model) { var layout = await _service.GetLayoutFromTabAsync(model.TabId); var success = await _service.SaveLayoutAsync(layout, model.LayoutList); var result = new TuxResponse { Success = true, Message = new TuxViewMessage( success ? "Layout saved." : "Layout NOT saved.", success ? TuxMessageType.Success : TuxMessageType.Danger, success) }; return(Json(result)); }