Feat: add update_student to service

This commit is contained in:
2022-12-30 10:34:20 +01:00
parent 94c942d055
commit 066990d109
3 changed files with 135 additions and 9 deletions

View File

@@ -26,10 +26,11 @@ class StudentSQLiteRepository(AbstractRepository):
def update(self, student: Student) -> None:
search_student = self.conn.execute(
"""
SELECT id FROM students WHERE id=:id
""",
SELECT id FROM students WHERE id=:id
""",
{"id": student.id},
).fetchone()
if search_student is None:
raise StudentRepositoryError(f"The student ({student.id=}) does not exists")