diff options
Diffstat (limited to 'src/service')
-rw-r--r-- | src/service/tasks.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/service/tasks.py b/src/service/tasks.py deleted file mode 100644 index 87194c4..0000000 --- a/src/service/tasks.py +++ /dev/null @@ -1,32 +0,0 @@ -from typing import List - -from model.task import Task, ValidTaskForm -from model.status import Status -import db.tasks -import db.task_tags -import database - -def get(cursor, status: Status) -> List[Task]: - return db.tasks.get(cursor, status) - -def create(cursor, status: Status, task_form: ValidTaskForm) -> Task: - task = db.tasks.insert(cursor, status, task_form) - db.task_tags.insert_many(cursor, task.id, task_form.tags) - database.commit() - return task - -def update(cursor, task: Task, task_form: ValidTaskForm) -> Task: - db.task_tags.delete(cursor, [task.id]) - updated_task = db.tasks.update(cursor, task, task_form) - db.task_tags.insert_many(cursor, task.id, task_form.tags) - database.commit() - return updated_task - -def delete(cursor, task_ids: List[int]): - db.task_tags.delete(cursor, task_ids) - db.tasks.delete(cursor, task_ids) - database.commit() - -def update_status(cursor, task_ids: List[int], status: Status) -> List[Task]: - db.tasks.update_status(cursor, task_ids, status) - database.commit() |