fixes the calendar choice

This commit is contained in:
2017-07-05 11:29:15 +02:00
parent 0952e80d4a
commit 13297a04ed
12 changed files with 218 additions and 227 deletions

View File

@ -10,7 +10,6 @@ using Microsoft.Extensions.OptionsModel;
using Microsoft.Data.Entity;
using System;
using System.Collections.Generic;
using System.Net;
using Microsoft.Extensions.Localization;
using Yavsc.Models.Workflow;
using Yavsc.Models.Identity;
@ -272,20 +271,12 @@ namespace Yavsc.Controllers
}
[HttpGet]
public async Task<IActionResult> SetGoogleCalendar(string returnUrl)
public async Task<IActionResult> SetGoogleCalendar(string returnUrl, string pageToken)
{
try
{
ViewBag.Calendars = await _calendarManager.GetCalendarsAsync(User.GetUserId());
}
catch (WebException ex)
{
// a bug
_logger.LogError("Google Api error");
_logger.LogError("Code: "+ex.HResult+"\n"+ ex.Message);
return RedirectToAction("LinkLogin", new { provider = "Google" });
}
return View(new SetGoogleCalendarViewModel { ReturnUrl = returnUrl });
return View(new SetGoogleCalendarViewModel {
ReturnUrl = returnUrl,
Calendars = await _calendarManager.GetCalendarsAsync(User.GetUserId(), pageToken)
});
}
[HttpPost, ValidateAntiForgeryToken]