Improved endpoint to edit task data

This commit is contained in:
Marcin-Ramotowski
2025-03-16 13:55:30 +00:00
parent 8bb71309ea
commit 9bce8b0a46
3 changed files with 24 additions and 20 deletions

View File

@ -12,6 +12,7 @@ class User(db.Model):
def to_dict(self):
return {"id": self.id, "username": self.username, "email": self.email, "role": self.role}
@classmethod
def get_editable_fields():
return {"username", "email", "role", "password"}
@ -30,5 +31,8 @@ class Task(db.Model):
"description": self.description,
"due_date": self.due_date,
"done": self.done,
"user_id": self.user_id
}
@classmethod
def get_editable_fields():
return {"title", "description", "due_date", "done"}