summaryrefslogtreecommitdiff
path: root/internal/store/native_tasks.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/store/native_tasks.go')
-rw-r--r--internal/store/native_tasks.go21
1 files changed, 0 insertions, 21 deletions
diff --git a/internal/store/native_tasks.go b/internal/store/native_tasks.go
index ca19377..5758407 100644
--- a/internal/store/native_tasks.go
+++ b/internal/store/native_tasks.go
@@ -2,7 +2,6 @@ package store
import (
"encoding/json"
- "log"
"time"
"task-dashboard/internal/models"
@@ -96,26 +95,6 @@ func (s *Store) UncompleteNativeTask(id string) error {
return err
}
-// ImportFromTodoist copies all incomplete tasks from the Todoist cache into native_tasks.
-// Skips tasks already present (by ID). Returns the count of newly imported tasks.
-func (s *Store) ImportFromTodoist() (int, error) {
- result, err := s.db.Exec(`
- INSERT OR IGNORE INTO native_tasks
- (id, content, description, project_name, due_date, priority, completed, labels, created_at, updated_at)
- SELECT
- id, content, COALESCE(description, ''), COALESCE(project_name, ''),
- due_date, priority, 0, COALESCE(labels, '[]'), created_at, CURRENT_TIMESTAMP
- FROM tasks
- WHERE completed = 0
- `)
- if err != nil {
- return 0, err
- }
- n, _ := result.RowsAffected()
- log.Printf("ImportFromTodoist: imported %d tasks", n)
- return int(n), nil
-}
-
func scanNativeTasks(rows interface{ Next() bool; Scan(...interface{}) error; Err() error }) ([]models.Task, error) {
var tasks []models.Task
for rows.Next() {