void RenderRecommendedPlanList() { RestClient.Get <ServerResponse <List <Plan> > > (App.instance.config.host + "/plan").Then((result) => { recommendedPlanList.SetData(result.data); }).Catch((error) => { Debug.Log(error.Message); recommendedPlanList.ShowErrorPanel(); }); }
public void LoadPlans(PlanList list, string url, int page = 1) { list.ShowLoadingPanel(); RestClient.Get <ServerResponse <List <Plan> > > (App.instance.config.host + url + "?page=" + page.ToString()).Then((result) => { if (page > 1) { List <Plan> data = list.GetData(); data.AddRange(result.data); list.SetData(data); } else { list.SetData(result.data); } }).Catch((error) => { list.ShowErrorPanel(); }); }