Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated reminder endpoint #66

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/Todoist.Net.Tests/Services/RemindersServiceTests.cs
Original file line number Diff line number Diff line change
@@ -29,20 +29,18 @@ public async Task CreateDelete_Success()
var transaction = client.CreateTransaction();

var itemId = await transaction.Items.AddAsync(new AddItem("Temp"));
var reminderId =
await transaction.Reminders.AddAsync(new Reminder(itemId) { DueDate = DueDate.CreateFloating(DateTime.UtcNow.AddDays(1)) });
var reminder = new Reminder(itemId) { DueDate = DueDate.CreateFloating(DateTime.UtcNow.AddDays(1)) };
await transaction.Reminders.AddAsync(reminder);
await transaction.CommitAsync();
try
{
var reminders = await client.Reminders.GetAsync();
Assert.True(reminders.Any());

var reminderInfo = await client.Reminders.GetAsync(reminderId);
Assert.NotNull(reminderInfo);
Assert.Contains(reminders, r => r.Id == reminder.Id);
}
finally
{
await client.Reminders.DeleteAsync(reminderId);
await client.Reminders.DeleteAsync(reminder.Id);
await client.Items.DeleteAsync(itemId);
}
}
11 changes: 0 additions & 11 deletions src/Todoist.Net/Services/IReminersService.cs
Original file line number Diff line number Diff line change
@@ -19,16 +19,5 @@ public interface IRemindersService : IRemindersCommandService
/// <returns>The filters.</returns>
/// <exception cref="HttpRequestException">API exception.</exception>
Task<IEnumerable<Reminder>> GetAsync(CancellationToken cancellationToken = default);

/// <summary>
/// Gets a reminder info by ID.
/// </summary>
/// <param name="id">The ID of the reminder.</param>
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>
/// The reminder info.
/// </returns>
/// <exception cref="HttpRequestException">API exception.</exception>
Task<ReminderInfo> GetAsync(ComplexId id, CancellationToken cancellationToken = default);
}
}
14 changes: 0 additions & 14 deletions src/Todoist.Net/Services/ReminersService.cs
Original file line number Diff line number Diff line change
@@ -23,19 +23,5 @@ public async Task<IEnumerable<Reminder>> GetAsync(CancellationToken cancellation

return response.Reminders;
}

/// <inheritdoc/>
public Task<ReminderInfo> GetAsync(ComplexId id, CancellationToken cancellationToken = default)
{
return TodoistClient.PostAsync<ReminderInfo>(
"reminders/get",
new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>(
"reminder_id",
id.ToString())
},
cancellationToken);
}
}
}