fix: abstract errors

This commit is contained in:
def 2023-01-15 03:47:09 +04:00
parent 575917fb5b
commit 94cf102c0b
2 changed files with 10 additions and 4 deletions

View file

@ -14,15 +14,15 @@ class AbstractDatabaseRepository(ABC):
""""""
@abstractmethod
def get_user_by_id(self) -> User:
def get_user_by_id(self, user_id: str) -> User:
""""""
@abstractmethod
def update_user_by_id(self) -> User:
def update_user(self, user: User) -> User:
""""""
@abstractmethod
def delete_user(self) -> None:
def delete_user(self, user_id: str) -> None:
""""""
@abstractmethod

View file

@ -81,7 +81,7 @@ class SQLiteDatabaseRepository(AbstractDatabaseRepository):
user.username,
user.avatar_hash,
),
).fetchall()
)
except sqlite3.IntegrityError:
return UserAlreadyExistError("User already exist!")
@ -90,6 +90,9 @@ class SQLiteDatabaseRepository(AbstractDatabaseRepository):
return self.get_user_by_id(user_id=user.user_id)
def update_user(self) -> None:
""""""
def delete_user(self) -> None:
""""""
@ -99,5 +102,8 @@ class SQLiteDatabaseRepository(AbstractDatabaseRepository):
def get_matrix_room(self) -> MatrixRoom:
""""""
def update_matrix_room(self) -> MatrixRoom:
""""""
def delete_matrix_room(self) -> None:
""""""