mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-22 06:38:17 +02:00
feat: add due dates support for todos
- Update Todo interface to include due_date, parent_id, level fields - Add due_date parameter to NotesService.addTodo method - Add due_date parameter to TodosService.createTodo method - updateTodo already supports Partial<Todo> including due_date - Backend migrations already created (003 and 004) - Prepare foundation for due date UI in future updates
This commit is contained in:
2 files changed
+16
-4
No files matched your search
@@ -33,9 +33,13 @@ class TodosService {
|
||||
}
|
||||
}
|
||||
|
||||
async createTodo(text: string, priority?: boolean): Promise<Todo> {
|
||||
async createTodo(text: string, priority?: boolean, dueDate?: string): Promise<Todo> {
|
||||
try {
|
||||
const response = await axios.post(this.baseURL, { text, priority: priority || false, completed: false }, this.getAuthHeader());
|
||||
const payload: any = { text, priority: priority || false, completed: false };
|
||||
if (dueDate) {
|
||||
payload.due_date = dueDate;
|
||||
}
|
||||
const response = await axios.post(this.baseURL, payload, this.getAuthHeader());
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error('Error creating todo:', error);
|
||||
|
||||
Reference in new issue
Block a user