feat: add CalendarInfo shared DTO, retire GoogleCalendar
Creates the new CalendarInfo shared DTO to replace GoogleCalendar with a more generic name suitable for both Google Calendar and Nextcloud CalDAV integration. Updates client-side references to use CalendarInfo instead of GoogleCalendar. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a36530b976
commit
b72e9b073c
3 changed files with 11 additions and 9 deletions
|
|
@ -23,7 +23,7 @@ namespace ShiftScheduler.Client.Pages
|
|||
private bool _showCalendarSelector = false;
|
||||
private string _errorMessage = string.Empty;
|
||||
private string _successMessage = string.Empty;
|
||||
private List<GoogleCalendar> _availableCalendars = new();
|
||||
private List<CalendarInfo> _availableCalendars = new();
|
||||
|
||||
private MonthAndYear SelectedDate => _isCurrentMonth ? MonthAndYear.Current() : MonthAndYear.Next();
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ namespace ShiftScheduler.Client.Pages
|
|||
var response = await HttpClient.GetAsync("api/shift/google_calendars");
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
_availableCalendars = await response.Content.ReadFromJsonAsync<List<GoogleCalendar>>() ?? new();
|
||||
_availableCalendars = await response.Content.ReadFromJsonAsync<List<CalendarInfo>>() ?? new();
|
||||
|
||||
if (_availableCalendars.Count == 1)
|
||||
{
|
||||
|
|
|
|||
7
Shared/CalendarInfo.cs
Normal file
7
Shared/CalendarInfo.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
namespace ShiftScheduler.Shared;
|
||||
|
||||
public class CalendarInfo
|
||||
{
|
||||
public string Id { get; set; } = string.Empty;
|
||||
public string Summary { get; set; } = string.Empty;
|
||||
}
|
||||
|
|
@ -1,7 +1,2 @@
|
|||
// Class renamed to CalendarInfo — see Shared/CalendarInfo.cs
|
||||
namespace ShiftScheduler.Shared;
|
||||
|
||||
public class GoogleCalendar
|
||||
{
|
||||
public string Id { get; set; } = string.Empty;
|
||||
public string Summary { get; set; } = string.Empty;
|
||||
}
|
||||
Loading…
Reference in a new issue