Skip to content

Commit

Permalink
Add Reminder
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwsteenbergen committed Feb 7, 2025
1 parent d7248c8 commit 1ef63a3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ApiLibs/Todoist/TodoistService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@ public async Task<long> AddTodo(string name, long? project_id = null, string dat
return res.TempIdMapping.Values.FirstOrDefault();
}

public async Task<long> AddReminder(Reminder reminder)
{
var res = await MakeRequest<SyncResult>("sync", parameters: new List<Param>
{
new TodoistCommand("reminder_add", reminder).ToParam()
});
return res.TempIdMapping.Values.FirstOrDefault();
}


public async Task<List<long>> AddTodo(IEnumerable<Item> items)
{
Expand Down Expand Up @@ -307,6 +316,11 @@ public TodoistCommand(string type, Project args) : this(type)
Arguments = args;
}

public TodoistCommand(string type, Reminder args) : this(type)
{
Arguments = args;
}

public string ToCommand()
{
var jsonSerializerSettings = new JsonSerializerSettings();
Expand Down

0 comments on commit 1ef63a3

Please sign in to comment.