Skip to content

Commit 3cf5408

Browse files
authored
Remove deprecated reminder endpoint (#66)
1 parent 184e5f7 commit 3cf5408

File tree

3 files changed

+4
-31
lines changed

3 files changed

+4
-31
lines changed

src/Todoist.Net.Tests/Services/RemindersServiceTests.cs

+4-6
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,18 @@ public async Task CreateDelete_Success()
2929
var transaction = client.CreateTransaction();
3030

3131
var itemId = await transaction.Items.AddAsync(new AddItem("Temp"));
32-
var reminderId =
33-
await transaction.Reminders.AddAsync(new Reminder(itemId) { DueDate = DueDate.CreateFloating(DateTime.UtcNow.AddDays(1)) });
32+
var reminder = new Reminder(itemId) { DueDate = DueDate.CreateFloating(DateTime.UtcNow.AddDays(1)) };
33+
await transaction.Reminders.AddAsync(reminder);
3434
await transaction.CommitAsync();
3535
try
3636
{
3737
var reminders = await client.Reminders.GetAsync();
38-
Assert.True(reminders.Any());
3938

40-
var reminderInfo = await client.Reminders.GetAsync(reminderId);
41-
Assert.NotNull(reminderInfo);
39+
Assert.Contains(reminders, r => r.Id == reminder.Id);
4240
}
4341
finally
4442
{
45-
await client.Reminders.DeleteAsync(reminderId);
43+
await client.Reminders.DeleteAsync(reminder.Id);
4644
await client.Items.DeleteAsync(itemId);
4745
}
4846
}

src/Todoist.Net/Services/IReminersService.cs

-11
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,5 @@ public interface IRemindersService : IRemindersCommandService
1919
/// <returns>The filters.</returns>
2020
/// <exception cref="HttpRequestException">API exception.</exception>
2121
Task<IEnumerable<Reminder>> GetAsync(CancellationToken cancellationToken = default);
22-
23-
/// <summary>
24-
/// Gets a reminder info by ID.
25-
/// </summary>
26-
/// <param name="id">The ID of the reminder.</param>
27-
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
28-
/// <returns>
29-
/// The reminder info.
30-
/// </returns>
31-
/// <exception cref="HttpRequestException">API exception.</exception>
32-
Task<ReminderInfo> GetAsync(ComplexId id, CancellationToken cancellationToken = default);
3322
}
3423
}

src/Todoist.Net/Services/ReminersService.cs

-14
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,5 @@ public async Task<IEnumerable<Reminder>> GetAsync(CancellationToken cancellation
2323

2424
return response.Reminders;
2525
}
26-
27-
/// <inheritdoc/>
28-
public Task<ReminderInfo> GetAsync(ComplexId id, CancellationToken cancellationToken = default)
29-
{
30-
return TodoistClient.PostAsync<ReminderInfo>(
31-
"reminders/get",
32-
new List<KeyValuePair<string, string>>
33-
{
34-
new KeyValuePair<string, string>(
35-
"reminder_id",
36-
id.ToString())
37-
},
38-
cancellationToken);
39-
}
4026
}
4127
}

0 commit comments

Comments
 (0)